Skip to content

Commit

Permalink
Enhance safety checks in workflow to skip upload jobs for RC builds
Browse files Browse the repository at this point in the history
This commit enhances the conditional checks within the 'upload' and 'upload-tag' jobs in our GitHub Actions workflows.

Previously, the jobs were executed based solely on the 'prerelease' flag of the release. However, there could be situations where this flag is accidentally set to 'false' for a Release Candidate (RC).

To avoid such mishaps, the conditions have been extended to check for the '-rc' suffix in the version string as well. This ensures that even if the 'prerelease' flag is incorrectly marked as 'false', the 'upload' and 'upload-tag' jobs are still skipped for RCs, thus preventing any unintended release of RC builds.
  • Loading branch information
fullofcaffeine committed May 26, 2023
1 parent 86f4168 commit eae536a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/upload-release-to-plugin-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ 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.prerelease || !contains(github.event.release.name, '-rc')) &&
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 +221,9 @@ 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.prerelease || !contains(github.event.release.name, '-rc')) &&
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 eae536a

Please sign in to comment.