From d5c453e9b612d387cb35fbde49bce702cd203786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ad=C3=A1mek?= Date: Thu, 2 Jul 2026 15:33:14 +0200 Subject: [PATCH] ci: Expand abbreviated SHA to full when creating release tag The `apify/actions/signed-commit` action outputs an abbreviated commit SHA, but the git refs API rejects it ("At least 40 characters are required"), so tag creation failed after a successful NPM publish. Resolve the full SHA via the commits API before creating the ref. --- .github/workflows/publish_to_npm.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_to_npm.yaml b/.github/workflows/publish_to_npm.yaml index 30d6ede..a879fe2 100644 --- a/.github/workflows/publish_to_npm.yaml +++ b/.github/workflows/publish_to_npm.yaml @@ -74,9 +74,12 @@ jobs: TAG_NAME: "v${{ steps.get_version.outputs.VERSION }}" COMMIT_SHA: ${{ steps.commit-release.outputs.commit_sha }} run: | + # `signed-commit` outputs an abbreviated SHA, but the git refs API + # requires the full 40-character SHA — expand it first. + FULL_SHA=$(gh api "repos/${GITHUB_REPOSITORY}/commits/${COMMIT_SHA}" --jq '.sha') gh api -X POST "repos/${GITHUB_REPOSITORY}/git/refs" \ -f ref="refs/tags/${TAG_NAME}" \ - -f sha="${COMMIT_SHA}" + -f sha="${FULL_SHA}" # Generate release notes only from the current version - name: Generate changelog for release notes