From b01cb9d69cb87adbd1491f55ff9e54b399ed560d Mon Sep 17 00:00:00 2001 From: asraa Date: Fri, 24 Mar 2023 18:40:49 -0500 Subject: [PATCH] chore: report scheduled release workflow failures (#543) * chore: report scheduled release workflow failures Signed-off-by: Asra Ali * fix: fix yamllint Signed-off-by: Asra Ali * empty commit Signed-off-by: Asra Ali --------- Signed-off-by: Asra Ali Co-authored-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com> --- .github/workflows/release.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 78e8225..0d584c9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,6 +15,8 @@ permissions: read-all env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} ISSUE_REPOSITORY: slsa-framework/slsa-verifier + # In case daily runs fail, the label for filing the issue + HEADER: release jobs: # Generate ldflags dynamically. @@ -57,6 +59,7 @@ jobs: verification: needs: [builder] runs-on: ubuntu-latest + if: github.event_name != 'schedule' permissions: read-all steps: - name: Install the verifier @@ -85,3 +88,32 @@ jobs: --source-uri "github.com/$GITHUB_REPOSITORY" \ --source-tag "$GITHUB_REF_NAME" \ "$ARTIFACT" + + if-succeed: + needs: [args, builder] + runs-on: ubuntu-latest + # We use `== 'failure'` instead of ` != 'success'` because we want to ignore skipped jobs, if there are any. + if: github.event_name == 'schedule' && needs.args.result != 'failure' && needs.builder.result != 'failure' + permissions: + contents: read + issues: write + steps: + - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 + with: + repository: slsa-framework/example-package + ref: main + - run: ./.github/workflows/scripts/e2e-report-success.sh + + if-failed: + needs: [args, builder] + runs-on: ubuntu-latest + if: always() && github.event_name == 'schedule' && (needs.args.result == 'failure' || needs.builder.result == 'failure') + permissions: + contents: read + issues: write + steps: + - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 + with: + repository: slsa-framework/example-package + ref: main + - run: ./.github/workflows/scripts/e2e-report-failure.sh