Skip to content

feat: make release label optional#9

Merged
shavonn merged 1 commit into
mainfrom
feat/release-label-optional
Apr 1, 2026
Merged

feat: make release label optional#9
shavonn merged 1 commit into
mainfrom
feat/release-label-optional

Conversation

@shavonn
Copy link
Copy Markdown
Contributor

@shavonn shavonn commented Apr 1, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 1, 2026 01:16
@shavonn shavonn merged commit 5451258 into main Apr 1, 2026
2 checks passed
@shavonn shavonn deleted the feat/release-label-optional branch April 1, 2026 01:18
@github-actions github-actions Bot mentioned this pull request Apr 1, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an option to make “release label required” configurable for the Release Champion GitHub Action, allowing releases to be gated by a label only when explicitly enabled.

Changes:

  • Add a new require-release-label input and plumb it through the composite action environment.
  • Update phase-detection logic to create release PRs on every merged PR when the label requirement is disabled.
  • Refresh README guidance and examples to document the new optional label gating.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
scripts/main.sh Adds conditional logic to bypass label checks when require-release-label is not enabled.
action.yml Introduces require-release-label input and exports it to the runtime environment.
README.md Updates usage/docs to reflect optional label gating and adds configuration examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread action.yml
require-release-label:
description: 'Require the release label to trigger a release PR. When false, every merged PR triggers a release.'
required: false
default: 'false'
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

require-release-label defaults to false, which changes the action’s default behavior from “only labeled PRs create a release PR” to “every merged PR creates a release PR”. To avoid a breaking change for existing users on @v1, consider defaulting this input to true (preserve prior behavior) and let users opt out, or publish this under a new major version and call out the breaking change prominently.

Suggested change
default: 'false'
default: 'true'

Copilot uses AI. Check for mistakes.
Comment thread action.yml
Comment on lines 11 to +16
release-label:
description: 'Label that marks a PR for release'
required: false
default: 'change-release'
require-release-label:
description: 'Require the release label to trigger a release PR. When false, every merged PR triggers a release.'
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The release-label input description still implies the label controls releases unconditionally, but with require-release-label it’s only used when the requirement is enabled. Update this description to match the new semantics so the action metadata (Marketplace / action.yml) doesn’t contradict the README.

Copilot uses AI. Check for mistakes.
Comment thread scripts/main.sh
echo "Release label not required — creating release PR"
bash "$SCRIPT_DIR/create-release-pr.sh"

elif echo "$PR_LABELS" | tr ',' '\n' | grep -qx "$INPUT_RELEASE_LABEL"; then
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

Label matching uses grep -qx, which treats INPUT_RELEASE_LABEL as a regex. If a label name contains regex metacharacters, this can produce incorrect matches. Use fixed-string matching (e.g., grep -F) so the label is matched literally.

Suggested change
elif echo "$PR_LABELS" | tr ',' '\n' | grep -qx "$INPUT_RELEASE_LABEL"; then
elif echo "$PR_LABELS" | tr ',' '\n' | grep -Fqx "$INPUT_RELEASE_LABEL"; then

Copilot uses AI. Check for mistakes.
Comment thread scripts/main.sh
Comment on lines +20 to +23
elif [[ "${INPUT_REQUIRE_RELEASE_LABEL:-false}" != "true" ]]; then
# Phase 1: Label not required — every merged PR triggers a release
echo "Release label not required — creating release PR"
bash "$SCRIPT_DIR/create-release-pr.sh"
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The new require-release-label branching changes the phase-detection logic but there are no automated tests covering scripts/main.sh behavior. Since the repo already uses Bats, consider adding a small Bats test suite for main.sh to assert the action triggers/releases correctly when require-release-label is true vs false and when the PR is a release/* branch.

Copilot uses AI. Check for mistakes.
@shavonn shavonn added the enhancement New feature or request label Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change-release enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants