diff --git a/.github/labels.yml b/.github/labels.yml index c00232c..f6526ba 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -28,3 +28,9 @@ - name: good first issue description: A good first issue to get started with color: d3fc03 +- name: "failure:release" + description: An issue filed automatically when a release workflow run fails + color: f00a0a +- name: "failure:push" + description: An issue filed automatically when a push buildpackage workflow run fails + color: f00a0a diff --git a/.github/workflows/create-draft-release.yml b/.github/workflows/create-draft-release.yml index 0336e28..e2b63ed 100644 --- a/.github/workflows/create-draft-release.yml +++ b/.github/workflows/create-draft-release.yml @@ -110,3 +110,22 @@ jobs: "content_type": "application/gzip" } ] + + failure: + name: Alert on Failure + runs-on: ubuntu-latest + needs: [ unit, integration, release ] + if: ${{ always() && needs.unit.result == 'failure' || needs.integration.result == 'failure' || needs.release.result == 'failure' }} + steps: + - name: File Failure Alert Issue + uses: paketo-buildpacks/github-config/actions/issue/file@main + with: + token: ${{ secrets.GITHUB_TOKEN }} + repo: ${{ github.repository }} + label: "failure:release" + comment_if_exists: true + issue_title: "Failure: Create Draft Release workflow" + issue_body: | + Create Draft Release workflow [failed](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}). + comment_body: | + Another failure occurred: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} diff --git a/.github/workflows/push-buildpackage.yml b/.github/workflows/push-buildpackage.yml index 8a7d4f2..f294710 100644 --- a/.github/workflows/push-buildpackage.yml +++ b/.github/workflows/push-buildpackage.yml @@ -73,3 +73,22 @@ jobs: version: ${{ steps.event.outputs.tag_full }} address: ${{ steps.push.outputs.image }}@${{ steps.push.outputs.digest }} token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + + failure: + name: Alert on Failure + runs-on: ubuntu-latest + needs: [push] + if: ${{ always() && needs.push.result == 'failure' }} + steps: + - name: File Failure Alert Issue + uses: paketo-buildpacks/github-config/actions/issue/file@main + with: + token: ${{ secrets.GITHUB_TOKEN }} + repo: ${{ github.repository }} + label: "failure:push" + comment_if_exists: true + issue_title: "Failure: Push Buildpackage workflow" + issue_body: | + Push Buildpackage workflow [failed](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}). + comment_body: | + Another failure occurred: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}