From 89ad2345852c8bd0849ea89ca7b1ec482967ccf7 Mon Sep 17 00:00:00 2001 From: EOEboh Date: Tue, 28 Jul 2026 13:30:46 +0100 Subject: [PATCH] fix(ci): resolve the deploy ref with git, not actions/checkout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rollback still failed after fetch-depth: 0, with 'a branch or tag with the name 026f727 could not be found'. actions/checkout's ref input takes a branch, a tag, or a full 40-character SHA — an abbreviated one is not accepted, and abbreviated is how commits are actually quoted. Checks out the default branch with full history and then lets git move to the requested ref, which accepts branches, tags, and SHAs of any length. --- .github/workflows/deploy.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 177b8b4..5ec0c9f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,14 +27,20 @@ jobs: packages: write steps: + # Checked out at the default branch with full history, then moved to the + # requested ref by git. actions/checkout's own `ref` only accepts a + # branch, a tag, or a *full* 40-character SHA — an abbreviated one fails + # with "a branch or tag with the name ... could not be found". Rollbacks + # are quoted as short SHAs, so resolving it here accepts all of them. - uses: actions/checkout@v4 with: - ref: ${{ inputs.ref }} - # Full history: the default shallow fetch resolves `ref` as a branch - # or tag glob, so an arbitrary commit SHA cannot be checked out — and - # deploying a specific commit is exactly how a rollback is performed. fetch-depth: 0 + - name: Check out the requested ref + run: | + git checkout --detach "${{ inputs.ref }}" + echo "Checked out $(git rev-parse --short HEAD) from '${{ inputs.ref }}'" + - name: Record what is being deployed id: meta run: |