Skip to content

Commit

Permalink
Pr comments (#2933)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanfbrito authored Aug 21, 2024
1 parent 9af18f3 commit 49ad226
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/pull-request-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,37 @@ jobs:
dist/rocketchat-*.pkg
dist/rocketchat-*.exe
dist/rocketchat-*.snap
- name: Get Artifact URL
id: get-artifact-url
uses: actions/github-script@v6
with:
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const runId = context.runId;
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner,
repo,
run_id: runId
});
const artifact = artifacts.data.artifacts.find(a => a.name === '${{ runner.os }} Artifacts');
if (artifact) {
const url = `https://github.com/${owner}/${repo}/actions/runs/${runId}/artifacts/${artifact.id}`;
core.setOutput('artifact_url', url);
} else {
core.setFailed(`Artifact not found for ${artifact.name}`);
}
- name: Post PR Comment with the Artifact link
if: steps.get-artifact-url.outputs.artifact_url != ''
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: |
### [${{ runner.os }} installer download](${{ steps.get-artifact-url.outputs.artifact_url }})
header: '### Artifact for ${{ runner.os }}'
recreate: true
append: false

0 comments on commit 49ad226

Please sign in to comment.