Skip to content

fix(action): allow manual release trigger without releasable commits - #77

Merged
ivanmilevtues merged 1 commit into
mainfrom
fix/manual-release-force
Aug 7, 2026
Merged

fix(action): allow manual release trigger without releasable commits#77
ivanmilevtues merged 1 commit into
mainfrom
fix/manual-release-force

Conversation

@ivanmilevtues

Copy link
Copy Markdown
Member

Summary

  • Add workflow_dispatch input force_release to force release path in GitHub Actions.
  • On manual dispatch, if Release Please reports no user-facing commits, create one empty fix(action): ... commit on main so release workflow can proceed.
  • Keep existing conventional-commit-based automatic behavior unchanged for normal pushes.

How to use

  • Run manual release with:
    • release_as: e.g. 1.10.2
    • force_release: true

@codeboarding-review

Copy link
Copy Markdown
Contributor

Architecture review · analyzing…

⏳ CodeBoarding is analyzing the architecture changes in this PR. This usually takes a few minutes.

codeboarding-action · run 31165462097

@ivanmilevtues
ivanmilevtues merged commit 2fe1d47 into main Aug 7, 2026
2 of 3 checks passed
@ivanmilevtues
ivanmilevtues deleted the fix/manual-release-force branch August 7, 2026 09:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 93825f5fc7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

release-as: ${{ inputs.release_as || '' }}

- name: Create release trigger commit for manual forced release
if: ${{ github.event_name == 'workflow_dispatch' && inputs.force_release == true && steps.release.outputs.release_created == 'false' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Treat an unset release output as no release

When release-please-action v4 creates no release, the root release_created output is unset rather than the literal string 'false'. Consequently, a manual dispatch with force_release=true skips this step in exactly the no-release case it is intended to handle; test the output for falsiness or use the aggregate releases_created output instead.

Useful? React with 👍 / 👎.

echo "force_release requested, but release_as is required" >&2
exit 1
fi
git config user.name "github-actions[bot]"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Check out the repository before running git

When this forced step does run, the only actions/checkout invocation in the workflow occurs later and is guarded by release_created. The release-please action uses the GitHub API and does not populate GITHUB_WORKSPACE, so this first local git config runs outside a repository and exits under set -e before the trigger commit can be created.

Useful? React with 👍 / 👎.

git checkout main
git reset --hard origin/main
git commit --allow-empty -m "fix(action): trigger manual release ${{ inputs.release_as }}"
git push origin HEAD:main

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Do not rely on a GITHUB_TOKEN push to rerun the workflow

After this commit is pushed, the release-please action has already completed, so another workflow run is required to process the new fix commit. A push authenticated with the workflow's GITHUB_TOKEN does not trigger another push workflow, however, so even after adding the missing checkout this dispatch will stop after creating the commit and never create the requested release; rerun release-please in this job or use credentials that can trigger the follow-up workflow.

Useful? React with 👍 / 👎.

git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout main
git reset --hard origin/main
git commit --allow-empty -m "fix(action): trigger manual release ${{ inputs.release_as }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the requested version for the follow-up release

If the push is changed so that it does trigger another run, that run is a push event and therefore has no inputs.release_as; the new commit is simply a conventional fix commit, which requests a patch bump. Thus a forced non-patch version such as 2.0.0 would instead produce the next patch release. Encode the requested version in a Release-As footer or otherwise pass it to the run that processes this commit.

Useful? React with 👍 / 👎.

release-as: ${{ inputs.release_as || '' }}

- name: Create release trigger commit for manual forced release
if: ${{ github.event_name == 'workflow_dispatch' && inputs.force_release == true && steps.release.outputs.release_created == 'false' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Check for a release PR before adding the trigger commit

On a forced dispatch where releasable commits already exist, release-please can create or update a release PR without publishing a GitHub release, so release_created remains false or unset. Once the output comparison above is corrected, this fallback will therefore add a fabricated fix commit even though release-worthy commits were detected, contrary to the input's stated behavior; gate the fallback on whether a release PR was produced or updated rather than only on release publication.

Useful? React with 👍 / 👎.

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.

1 participant