Skip to content

Commit

Permalink
Fix pre-release trigger for update-bundle action
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Chuan-kai Lin authored and GitHub committed Apr 14, 2023
1 parent dc04638 commit ae24b75
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/update-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ae24b75

Please sign in to comment.