Skip to content

Comments

🐛 Enhance release workflow to support manual dispatch and prevent duplicate tags#185

Merged
ChristophShyper merged 1 commit intomasterfrom
bugfix/release-dispatch
Feb 18, 2026
Merged

🐛 Enhance release workflow to support manual dispatch and prevent duplicate tags#185
ChristophShyper merged 1 commit intomasterfrom
bugfix/release-dispatch

Conversation

@github-actions
Copy link
Contributor

📝 Brief description

🐛 Enhance release workflow to support manual dispatch and prevent duplicate tags

💻 Commits

  • 62a9f8d - ChristophShyper - 2026-02-18 22:02:43
    🐛 Enhance release workflow to support manual dispatch and prevent duplicate tags

📁 Modified files

.github/workflows/auto-create-release.yml | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)

⚠️ Additional information

  • Pushed to a branch with a proper name and provided proper commit message.
  • Provided a clear and concise description of what the issue is.

Check CONTRIBUTING.md and CODE_OF_CONDUCT.md for more information

Copy link
Contributor

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 enhances the auto-create-release workflow to support manual triggering via workflow_dispatch and adds logic to prevent duplicate tag creation. The changes aim to make the release process more flexible while adding safeguards against re-tagging existing releases.

Changes:

  • Added workflow_dispatch trigger to allow manual workflow execution
  • Updated job condition to allow workflow_dispatch events alongside merged pull requests
  • Implemented duplicate tag detection that checks if a tag already exists remotely before creating it, with different behaviors for manual vs automatic triggers

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


full_remote_sha="$(git ls-remote --tags origin "refs/tags/${REL_VERSION}" 2>/dev/null | awk '{print $1}' || true)"
if [ -n "${full_remote_sha}" ]; then
if [ "${GITHUB_EVENT_NAME}" = "workflow_dispatch" ]; then
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The environment variable reference is inconsistent with the GitHub Actions context used elsewhere. On line 18, the code uses github.event_name (the GitHub Actions context), but on line 46, it references ${GITHUB_EVENT_NAME} (an environment variable that is not defined).

In GitHub Actions, github.event_name is available in workflow expressions (like the if condition) but is not automatically available as an environment variable in shell scripts. You should either:

  1. Use ${{ github.event_name }} directly in the shell script
  2. Define GITHUB_EVENT_NAME in the env section and set it to ${{ github.event_name }}

The correct approach would be to use ${{ github.event_name }} in the conditional, like:

if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
Suggested change
if [ "${GITHUB_EVENT_NAME}" = "workflow_dispatch" ]; then
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then

Copilot uses AI. Check for mistakes.
release:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
if: >-
github.event_name == 'workflow_dispatch' ||
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The job condition allows execution on 'push' events to 'release/**' branches, but there is no check in the condition to handle this trigger type. The condition only checks for 'workflow_dispatch' or merged pull requests starting with 'release/'.

When a push event occurs to a 'release/**' branch, both parts of the OR condition will be false:

  • github.event_name == 'workflow_dispatch' will be false (it's a 'push' event)
  • github.event.pull_request.merged == true will be false (push events don't have pull_request data)

This means the job will never run for push events to release branches, even though they are listed as a trigger. Either remove the push trigger or add it to the condition, such as:

if: >-
  github.event_name == 'workflow_dispatch' ||
  github.event_name == 'push' ||
  (github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/'))
Suggested change
github.event_name == 'workflow_dispatch' ||
github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||

Copilot uses AI. Check for mistakes.
@ChristophShyper ChristophShyper merged commit f01d240 into master Feb 18, 2026
9 checks passed
@ChristophShyper ChristophShyper deleted the bugfix/release-dispatch branch February 18, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant