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 472262e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 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,14 @@ 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 +164,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 +227,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 472262e

Please sign in to comment.