Closed
Conversation
kasparsd
commented
Dec 10, 2025
| - name: WordPress Plugin Deploy | ||
| uses: 10up/action-wordpress-plugin-deploy@stable | ||
| with: | ||
| trunk-only: ${{ github.ref_name == 'main' }} |
Author
There was a problem hiding this comment.
Here we use the same deploy step on both branch and tag runs:
- Tag CI runs will set
trunk-onlytofalsewhich enables regular deploys. - Branch CI runs on
trunkbranch will deploy to trunk/assets only.
| # Allow setting custom version number in advanced workflows. | ||
| # By default, only derive VERSION from tag refs; branch refs will | ||
| # result in an empty VERSION so we can support trunk-only deployments. | ||
| if [[ -z "$VERSION" && "$GITHUB_REF" == refs/tags/* ]]; then |
Author
There was a problem hiding this comment.
Attempt to resolve the version from tag name only if this is a tag CI run.
| fi | ||
|
|
||
| # Cast to empty string when not set for easier -n checks. | ||
| if [[ "$INPUT_TRUNK_ONLY" != "true" ]]; then |
Author
There was a problem hiding this comment.
To avoid repeating "$INPUT_TRUNK_ONLY" != "true" on every conditional we normalize this to an empty string if the value is NOT true.
| svn cp "trunk" "tags/$VERSION" | ||
| # Copy tag locally to make this a single commit when not | ||
| # doing a trunk-only deployment. | ||
| if [[ -n "$VERSION" && -z "$INPUT_TRUNK_ONLY" ]]; then |
Author
There was a problem hiding this comment.
Here is the core change -- we only add a tag if this is not a trunk-only release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
Implement a
trunk-onlyaction input that skips the tag deploy and pushes to SVNtrunkandassetsonly.Closes #103
How to test the Change
trunk-only: trueand confirm that the updates were sent only to thetrunkandassetbranches without releasing a tag on SVN.Changelog Entry
Credits
Props @kasparsd
Checklist: