Skip to content

Commit

Permalink
Adding artifact url in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
himsharma01 committed Sep 28, 2024
1 parent ae6e4db commit 611a45e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/v2App_Unit_Test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ jobs:
with:
name: excel-sheet
path: appreviewoutput.xlsx
- name: Comment on PR with Excel Sheet
uses: actions/github-script@v4
- 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
uses: actions/github-script@4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const data = fs.readFileSync('output.csv', 'utf8');
const github = require('@actions/github');
const octokit = new github.getOctokit(process.env.GITHUB_TOKEN);
octokit.issues.createComment({
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 + '```'
})
body: 'Excel Sheet artifact URL: ' + '${{ steps.get_artifact_url.outputs.artifact_url }}'
})

0 comments on commit 611a45e

Please sign in to comment.