From 4b3818141f546db80ca4838f8de9527d283e2fce Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Fri, 17 Jul 2026 10:07:47 +0800 Subject: [PATCH] ci: trigger release manually instead of on push to main Removes the auto-release-on-push friction and makes cutting a release a deliberate action from the Actions tab. Adds a job-level guard so a manual dispatch from a non-main ref is a no-op instead of bumping and releasing off unreleased branch history. --- .github/workflows/release.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ecf8d31..b8df7c4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,13 @@ name: Release -# On push to main, commitizen bumps the version from conventional commits, -# writes the CHANGELOG, tags, then we build and publish to PyPI and cut a -# GitHub Release. Everything runs in one job, so it does not rely on the tag -# push triggering a second workflow and the default GITHUB_TOKEN is enough. +# Manually triggered from the Actions tab. Commitizen bumps the version from +# conventional commits, writes the CHANGELOG, tags, then we build and publish +# to PyPI and cut a GitHub Release. Everything runs in one job, so it does not +# rely on the tag push triggering a second workflow and the default +# GITHUB_TOKEN is enough. If there's no version change (nothing releasable), +# the remaining steps are skipped. on: - push: - branches: [main] + workflow_dispatch: concurrency: group: release-${{ github.ref }} @@ -18,9 +19,8 @@ permissions: jobs: release: - # Don't bump again on commitizen's own "bump:" commit. (Commits pushed with - # GITHUB_TOKEN don't re-trigger workflows anyway; this is belt-and-suspenders.) - if: "!startsWith(github.event.head_commit.message, 'bump:')" + # Guard against an accidental dispatch from a non-main branch/ref. + if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - uses: actions/checkout@v6