Skip to content

Commit

Permalink
Skip upload jobs if release is an RC by checking the ref for a rc suffix
Browse files Browse the repository at this point in the history
This makes sure we don't upload RCs as trunk or tag even if the deployer accidentally unchecks the "Set as prerelease" flag.
  • Loading branch information
fullofcaffeine committed May 26, 2023
1 parent d642211 commit aebc503
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/upload-release-to-plugin-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ jobs:
compute-should-update-trunk:
name: Decide if trunk or tag
runs-on: ubuntu-latest
# Skip this job if the release is a release candidate. This will in turn skip
# the upload jobs, which are only relevant for non-RC releases.
# We first check if the release is a prerelease, and then if the ref contains
# the string "rc". The latter is fallback in case the deployer accidentally
# unchecks the "This is a pre-release" checkbox in the release UI.
if: |
!github.event.release.prerelease || !contains(github.ref, 'rc')
outputs:
should_update_trunk: ${{ steps.compute_should_update_trunk.outputs.should_update_trunk }}

Expand Down Expand Up @@ -156,8 +163,7 @@ jobs:
environment: wp.org plugin
needs: [compute-should-update-trunk, update-changelog]
if: |
needs.compute-should-update-trunk.outputs.should_update_trunk == 'true' &&
!github.event.release.prerelease && github.event.release.assets[0]
needs.compute-should-update-trunk.outputs.should_update_trunk == 'true' && github.event.release.assets[0]
env:
PLUGIN_REPO_URL: 'http://caffeine.ngrok.io/svn/gutenberg'
STABLE_VERSION_REGEX: '[0-9]\+\.[0-9]\+\.[0-9]\+\s*'
Expand Down Expand Up @@ -220,8 +226,7 @@ jobs:
environment: wp.org plugin
needs: [compute-should-update-trunk, update-changelog]
if: |
needs.compute-should-update-trunk.outputs.should_update_trunk == 'false' &&
!github.event.release.prerelease && github.event.release.assets[0]
needs.compute-should-update-trunk.outputs.should_update_trunk == 'false' && github.event.release.assets[0]
env:
PLUGIN_REPO_URL: 'http://caffeine.ngrok.io/svn/gutenberg'
STABLE_VERSION_REGEX: '[0-9]\+\.[0-9]\+\.[0-9]\+\s*'
Expand Down

0 comments on commit aebc503

Please sign in to comment.