-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add package for pull request and comment, if trigger event is p…
…ull_request, comment on the pr.
- Loading branch information
Showing
3 changed files
with
101 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Comment on the pull request | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Package Neuron for Test"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
comment: | ||
name: Append links to the Pull Request | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- id: download_artifact | ||
uses: dawidd6/action-download-artifact@v2 | ||
continue-on-error: true | ||
with: | ||
name: package_info | ||
run_id: ${{ github.event.workflow_run.id }} | ||
|
||
- name: if non exist, skip comment | ||
if: ${{ steps.download_artifact.outcome == 'failure' }} | ||
run: exit 0 | ||
|
||
- id: pr_number | ||
run: | | ||
export PR_NUM=$(cat ./pr_number) | ||
echo "pr_num=$PR_NUM" >> $GITHUB_OUTPUT | ||
- id: run_id | ||
run: | | ||
export RUN_ID=$(cat ./run_id) | ||
echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT | ||
- id: sha | ||
run: | | ||
export SHA=$(cat ./sha) | ||
echo "sha=$SHA" >> $GITHUB_OUTPUT | ||
- uses: thollander/actions-comment-pull-request@v2 | ||
if: ${{ steps.pr_number.outputs.pr_num != '' && steps.run_id.outputs.run_id != '' }} | ||
with: | ||
message: | | ||
Packaging for test is done in [${{ steps.run_id.outputs.run_id }}](https://github.com/${{github.repository}}/actions/runs/${{steps.run_id.outputs.run_id}}) for commit https://github.com/${{github.repository}}/pull/${{steps.pr_number.outputs.pr_num}}/commits/${{steps.sha.outputs.sha}} . | ||
pr_number: ${{ steps.pr_number.outputs.pr_num }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters