Skip to content

Commit

Permalink
Updated excel comment logic
Browse files Browse the repository at this point in the history
  • Loading branch information
himsharma01 committed Sep 28, 2024
1 parent 30f47c5 commit fbcb600
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/V2App_review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [pull_request]

jobs:
v2-app-unit-test:
name: "V2 App Unit Test"
name: "V2 App Review"
runs-on: "ubuntu-latest"
env:
SUMO_APPS_V2_REPO_PATH: ${{ github.workspace }}
Expand Down Expand Up @@ -49,11 +49,25 @@ jobs:
- name: Get Artifact URL
id: get_artifact_url
run: echo "::set-output name=artifact_url::${{ steps.upload_artifact.outputs.artifact_url }}"
- name: Comment on PR with Artifact URL
run: |
PR_NUMBER=$(echo $GITHUB_REF | awk -F'/' '{print $3}')
ARTIFACT_URL="${{ steps.get_artifact_url.outputs.artifact_url }}"
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -d "{\"body\": \"Excel Sheet artifact URL: $ARTIFACT_URL\"}" "https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/comments"

- name: Comment on PR with Excel Sheet
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const data = fs.readFileSync('appreviewoutput.xlsx', 'utf8');
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Excel Sheet generated from the command:\n```' + data + '```'
})
# - name: Comment on PR with Artifact URL
# run: |
# PR_NUMBER=$(echo $GITHUB_REF | awk -F'/' '{print $3}')
# ARTIFACT_URL="${{ steps.get_artifact_url.outputs.artifact_url }}"
# curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -d "{\"body\": \"Excel Sheet artifact URL: $ARTIFACT_URL\"}" "https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/comments"
# - name: Comment on PR with Artifact URL
# uses: actions/github-script@v7
# with:
Expand Down

0 comments on commit fbcb600

Please sign in to comment.