Skip to content

Commit

Permalink
Fix comment publishing action
Browse files Browse the repository at this point in the history
  • Loading branch information
modos189 committed May 4, 2024
1 parent 5555c25 commit d8a7924
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
FILE_NAME="${FILE_NAME}-$(echo ${{ github.event.pull_request.head.sha }} | cut -c 1-6)"
echo "PR" > ./build/.metadata/build_type
echo ${{ github.event.pull_request.head.sha }} > ./build/.metadata/commit
echo ${{ github.event.number }} > ./build/.metadata/pr_number
fi
mv $ORIGINAL_FILE_NAME "./build/$FILE_NAME".zip
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/comment-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,24 @@ jobs:
core.exportVariable(urlVar, `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${runId}/artifacts/${artifact.id}`);
});
- name: Download and extract first artifact
uses: actions/download-artifact@v4
with:
name: ${{ steps.get-artifacts.outputs.artifact1 }}

- name: Extract PR number from artifact
run: |
if [ -f "build/.metadata/pr_number" ]; then
PR_NUMBER=$(cat build/.metadata/pr_number)
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
fi
- name: Comment with artifact links for PR
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ env.PR_NUMBER != '' }}
with:
header: pr_artifacts
number: ${{ github.event.workflow_run.pull_requests[0].number }}
number: ${{ env.PR_NUMBER }}
message: |
Build completed successfully. Below are the download links for the build artifacts:
Expand Down

0 comments on commit d8a7924

Please sign in to comment.