-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
infra: Comment about images built when all is done
- Loading branch information
1 parent
5c97c36
commit 2c0d639
Showing
2 changed files
with
56 additions
and
26 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 |
---|---|---|
|
@@ -201,19 +201,6 @@ jobs: | |
path: | | ||
images/*.iso | ||
- name: Add comment with link to PR | ||
if: github.event_name != 'workflow_dispatch' | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
sha="${{ needs.pr-info.outputs.sha }}" | ||
url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
echo -n "\`boot.iso\` built successfully based on commit $sha. " >> comment.txt | ||
echo -e "Download it from the bottom of the [job status page]($url).\n" >> comment.txt | ||
echo "Comment to be posted:" | ||
cat comment.txt | ||
gh pr comment ${{ github.event.issue.number }} -F comment.txt | ||
- name: Set result status | ||
if: always() | ||
uses: octokit/[email protected] | ||
|
@@ -304,3 +291,31 @@ jobs: | |
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
||
finalize: | ||
needs: [pr-info, boot-iso, live-cd] | ||
if: ${{ always() && !cancelled() && github.event_name != 'workflow_dispatch' && needs.pr-info.outputs.allowed_user == 'true' }} | ||
steps: | ||
- name: Add comment with link to PR | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
sha="${{ needs.pr-info.outputs.sha }}" | ||
url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts" | ||
echo -n "Images built based on commit $sha:\n" >> comment.txt | ||
if [[ "${{ needs.pr-info.outputs.args }}" == *"--boot.iso"* ]] ; then | ||
# <job>.result can be success, failure, cancelled, or skipped | ||
# https://docs.github.com/en/actions/learn-github-actions/contexts#jobs-context | ||
echo "- `boot.iso`: ${{ needs.boot-iso.result }}" >> comment.txt | ||
fi | ||
if [[ "${{ needs.pr-info.outputs.args }}" == *"--live"* ]] ; then | ||
echo "- Live: ${{ needs.live-cd.result }}" >> comment.txt | ||
fi | ||
echo -e "\n\nDownload the results from the bottom of the [job status page]($url).\n" >> comment.txt | ||
echo "Comment to be posted:" | ||
cat comment.txt | ||
gh pr comment ${{ github.event.issue.number }} -F comment.txt |
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 |
---|---|---|
|
@@ -195,19 +195,6 @@ jobs: | |
path: | | ||
images/*.iso | ||
|
||
- name: Add comment with link to PR | ||
if: github.event_name != 'workflow_dispatch' | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
sha="${{ needs.pr-info.outputs.sha }}" | ||
url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
echo -n "\`boot.iso\` built successfully based on commit $sha. " >> comment.txt | ||
echo -e "Download it from the bottom of the [job status page]($url).\n" >> comment.txt | ||
echo "Comment to be posted:" | ||
cat comment.txt | ||
gh pr comment ${{ github.event.issue.number }} -F comment.txt | ||
|
||
- name: Set result status | ||
if: always() | ||
uses: octokit/[email protected] | ||
|
@@ -298,4 +285,32 @@ jobs: | |
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
||
finalize: | ||
needs: [pr-info, boot-iso, live-cd] | ||
if: ${{ always() && !cancelled() && github.event_name != 'workflow_dispatch' && needs.pr-info.outputs.allowed_user == 'true' }} | ||
steps: | ||
- name: Add comment with link to PR | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
sha="${{ needs.pr-info.outputs.sha }}" | ||
url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts" | ||
|
||
echo -n "Images built based on commit $sha:\n" >> comment.txt | ||
if [[ "${{ needs.pr-info.outputs.args }}" == *"--boot.iso"* ]] ; then | ||
# <job>.result can be success, failure, cancelled, or skipped | ||
# https://docs.github.com/en/actions/learn-github-actions/contexts#jobs-context | ||
echo "- `boot.iso`: ${{ needs.boot-iso.result }}" >> comment.txt | ||
fi | ||
if [[ "${{ needs.pr-info.outputs.args }}" == *"--live"* ]] ; then | ||
echo "- Live: ${{ needs.live-cd.result }}" >> comment.txt | ||
fi | ||
echo -e "\n\nDownload the results from the bottom of the [job status page]($url).\n" >> comment.txt | ||
|
||
echo "Comment to be posted:" | ||
cat comment.txt | ||
|
||
gh pr comment ${{ github.event.issue.number }} -F comment.txt | ||
{% endif %} |