From 97de44b8afddf25d482128d112b2fbed326cbdfc Mon Sep 17 00:00:00 2001 From: bahdotsh Date: Thu, 2 Apr 2026 16:06:18 +0530 Subject: [PATCH] ci: fix workflow_dispatch releasing into the void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The release workflow happily accepts a manual dispatch with any tag string, then passes it to git log and softprops/action-gh-release without ever checking if the tag actually *exists* as a git ref. Confusion ensues — changelog generation silently produces garbage and the release gets created pointing at nothing useful. Add a tag validation step that fails fast with a clear error before any downstream jobs run. Since both build and release already depend on the changelog job via `needs`, this acts as a proper gate. While at it, add --all-features to the CI build and test steps so feature-gated code actually gets compiled and tested, not just linted by clippy. Having clippy check code that never gets built is the kind of false confidence that bites you on release day. --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1405646..826f662 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,6 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - - run: cargo build --workspace + - run: cargo build --workspace --all-features - run: cargo check --no-default-features --workspace - - run: cargo test --workspace + - run: cargo test --workspace --all-features diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14a3d26..1abaf19 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,6 +26,14 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Validate tag exists + env: + RELEASE_TAG: ${{ inputs.tag || github.ref_name }} + run: | + if ! git rev-parse "${RELEASE_TAG}" >/dev/null 2>&1; then + echo "::error::Tag ${RELEASE_TAG} does not exist in the repository" + exit 1 + fi - name: Generate changelog id: changelog env: