Skip to content

Add trunk-only deploys#173

Closed
kasparsd wants to merge 7 commits into10up:developfrom
kasparsd:add-trunk-only-deploys
Closed

Add trunk-only deploys#173
kasparsd wants to merge 7 commits into10up:developfrom
kasparsd:add-trunk-only-deploys

Conversation

@kasparsd
Copy link
Copy Markdown

@kasparsd kasparsd commented Dec 10, 2025

Description of the Change

Implement a trunk-only action input that skips the tag deploy and pushes to SVN trunk and assets only.

Closes #103

How to test the Change

  • Setup an action with trunk-only: true and confirm that the updates were sent only to the trunk and asset branches without releasing a tag on SVN.

Changelog Entry

Added - Support for trunk-only deploys that useful for updates to plugin assets (icon, graphics) and "Tested up to" version without doing full releases.

Credits

Props @kasparsd

Checklist:

@kasparsd kasparsd requested a review from a team as a code owner December 10, 2025 16:19
@kasparsd kasparsd requested review from peterwilsoncc and removed request for a team December 10, 2025 16:19
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
with:
trunk-only: ${{ github.ref_name == 'main' }}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we use the same deploy step on both branch and tag runs:

  1. Tag CI runs will set trunk-only to false which enables regular deploys.
  2. Branch CI runs on trunk branch 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
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the core change -- we only add a tag if this is not a trunk-only release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option for a trunk-only deployment

1 participant