Skip to content

Commit

Permalink
add template for failed package builds
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbsa committed Sep 25, 2023
1 parent bccd30f commit fc07bdd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/comment-templates/failed-builds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<h1> Automated tests Summary</h1>
<h3><strong>:rotating_light:</strong> The following packages have failed to build</h3>

{{ .packages }}

___

[Click here]({{ .server_url }}/{{ .repository }}/actions/runs/{{ .workflow-id }}) to check the action test reports
24 changes: 17 additions & 7 deletions .github/workflows/publish-test-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
pull-requests: write
needs: get-pr-data
steps:
- uses: actions/checkout@v3
- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
Expand All @@ -78,18 +79,27 @@ jobs:
body: |
<h1>Automated tests Summary</h1>
<h3><strong>:white_check_mark:</strong> All the CI tests have passed!</h3>
- run: |
for pckg in $(cat ./failed-builds); do echo -n "- $pckg\n" >> ./pckg-list; done;
echo "list=(cat ./pckg-list)"" >> $GITHUB_OUTPUT;
id: package-list
- name: Render failing build comment
if: ${{ github.event.workflow_run.conclusion == 'failure' && needs.get-pr-data.outputs.failure-reason == 'build-package' }}
id: template
uses: chuhlomin/[email protected]
with:
template: .github/comment-templates/failed-builds.md
vars: |
packages: ${{ steps.package-list.outputs.list }}
server-url: ${{ github.server_url }}
repository: ${{ github.repository }}
workflow-id: ${{ needs.get-pr-data.outputs.workflow-id }}
- name: Failing build comment
if: ${{ github.event.workflow_run.conclusion == 'failure' && needs.get-pr-data.outputs.failure-reason == 'build-package' }}
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ needs.get-pr-data.outputs.pr-number }}
body: |
<h1> Automated tests Summary</h1>
<h3><strong>:rotating_light:</strong> Test workflow has failed some package build process</h3>
___
[Click here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ needs.get-pr-data.outputs.workflow-id }}) to check the action test reports
body: ${{ steps.template.outputs.result }}
- name: Failing install comment
if: ${{ github.event.workflow_run.conclusion == 'failure' && needs.get-pr-data.outputs.failure-reason == 'bbb-installation' }}
uses: peter-evans/create-or-update-comment@v2
Expand Down

0 comments on commit fc07bdd

Please sign in to comment.