Skip to content

feat(ci): add workflow_dispatch for retrying failed releases#33

Merged
carlos-alm merged 1 commit intomainfrom
fix/publish-workflow-dispatch
Feb 23, 2026
Merged

feat(ci): add workflow_dispatch for retrying failed releases#33
carlos-alm merged 1 commit intomainfrom
fix/publish-workflow-dispatch

Conversation

@carlos-alm
Copy link
Contributor

Summary

  • Adds workflow_dispatch trigger with a required version input to retry failed stable releases from the Actions UI
  • Routes workflow_dispatch through the stable publish path (version from input, npm_tag=latest, version bump PR + tag)
  • Uses event_name != 'push' guards so both release and workflow_dispatch run the stable-only steps

Test plan

  • Merge to main, then go to Actions > Publish > Run workflow, enter 2.1.0, verify it runs the full stable publish pipeline

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 23, 2026

Greptile Summary

Adds workflow_dispatch trigger to enable manual retries of failed stable releases from the Actions UI. The implementation routes manual triggers through the stable publish path using event_name != 'push' guards.

Key changes:

  • New workflow_dispatch trigger with required version input parameter
  • Updated conditional logic: event_name == 'release'event_name != 'push' for stable-only steps
  • Manual dispatches use npm_tag=latest and trigger version bump PR + tag creation

Issues found:

  • Missing input validation for version format - user could enter invalid semver or include "v" prefix
  • No protection against duplicate PR/branch creation on retries

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk - the logic is sound but could benefit from additional input validation
  • The implementation correctly extends the workflow to support manual retries. The conditional logic change from == 'release' to != 'push' is correct and handles both release and workflow_dispatch events. However, the lack of input validation on the version parameter could cause workflow failures if users provide malformed input. The existing npm version check will prevent duplicate publishes, but duplicate PR creation could cause confusion.
  • .github/workflows/publish.yml - verify version input validation is sufficient for your use case

Important Files Changed

Filename Overview
.github/workflows/publish.yml Adds workflow_dispatch trigger with version input for manual stable release retries; updates conditionals to use event_name != 'push' for stable-only steps

Last reviewed commit: 8d4f0cb

@carlos-alm carlos-alm merged commit bec0d20 into main Feb 23, 2026
13 checks passed
@carlos-alm carlos-alm deleted the fix/publish-workflow-dispatch branch February 23, 2026 01:52
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +58 to +61
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ inputs.version }}"
NPM_TAG="latest"
echo "Stable release (manual retry): $VERSION"
Copy link
Contributor

Choose a reason for hiding this comment

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

No validation on inputs.version format - could cause issues if user enters version with "v" prefix or invalid semver

Suggested change
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ inputs.version }}"
NPM_TAG="latest"
echo "Stable release (manual retry): $VERSION"
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ inputs.version }}"
# Validate semver format (no 'v' prefix)
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error::Invalid version format: $VERSION. Expected format: X.Y.Z (e.g., 2.1.0)"
exit 1
fi
NPM_TAG="latest"
echo "Stable release (manual retry): $VERSION"

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 23, 2026

Additional Comments (1)

.github/workflows/publish.yml
Consider checking if branch/PR already exists before creating to avoid errors on retry

          # Check if there are version bump changes to push
          if git diff --quiet HEAD; then
            echo "No version bump commit to push — skipping PR"
          else
            # Check if branch already exists
            if git ls-remote --heads origin "refs/heads/${BRANCH}" | grep -q .; then
              echo "Branch ${BRANCH} already exists — skipping PR creation"
            else
              git add -A
              git commit -m "chore: release v${VERSION}"
              git push origin "HEAD:refs/heads/${BRANCH}"
              gh pr create \
                --base main \
                --head "$BRANCH" \
                --title "chore: release v${VERSION}" \
                --body "Automated version bump to \`${VERSION}\` and CHANGELOG update from publish workflow run [#${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})."
              echo "::notice::Version bump PR created for ${BRANCH} → main"
            fi
          fi

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