From ae24b75fca1b386dfd88209f2738158b7b02c21b Mon Sep 17 00:00:00 2001 From: Chuan-kai Lin Date: Fri, 14 Apr 2023 14:50:37 -0700 Subject: [PATCH] Fix pre-release trigger for update-bundle action This PR switches the update-bundle release trigger from `prereleased` to `published` because the former has been documented not to work. From https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release: > Note: The prereleased type will not trigger for pre-releases published from draft releases, but the published type will trigger. If you want a workflow to run when stable and pre-releases publish, subscribe to published instead of released and prereleased. --- .github/workflows/update-bundle.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-bundle.yml b/.github/workflows/update-bundle.yml index a94d11e934..1f11656b67 100644 --- a/.github/workflows/update-bundle.yml +++ b/.github/workflows/update-bundle.yml @@ -2,11 +2,20 @@ name: Update default CodeQL bundle on: release: - types: [prereleased] + # From https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release + # Note: The prereleased type will not trigger for pre-releases published + # from draft releases, but the published type will trigger. If you want a + # workflow to run when stable and pre-releases publish, subscribe to + # published instead of released and prereleased. + # + # From https://github.com/orgs/community/discussions/26281 + # As a work around, in published type workflow, you could add if condition + # to filter pre-release attribute. + types: [published] jobs: update-bundle: - if: startsWith(github.event.release.tag_name, 'codeql-bundle-') + if: github.event.release.prerelease && startsWith(github.event.release.tag_name, 'codeql-bundle-') runs-on: ubuntu-latest steps: - name: Dump environment