Skip to content

ci: Expand abbreviated SHA to full when creating release tag - #7

Merged
B4nan merged 1 commit into
mainfrom
fix/release-tag-full-sha
Jul 2, 2026
Merged

B4nan merged 1 commit into
mainfrom
fix/release-tag-full-sha

Conversation

@B4nan

@B4nan B4nan commented Jul 2, 2026

Copy link
Copy Markdown
Member

Same bug that broke publishing in apify/apify-oxlint-config#20 — this repo's publish_to_npm.yaml has the identical setup.

The apify/actions/signed-commit action outputs an abbreviated commit SHA, but POST /git/refs requires the full 40-character SHA ("At least 40 characters are required"). As a result the release tag creation fails after NPM publish has already succeeded, leaving a published version with no git tag or GitHub release.

Fix: resolve the full SHA via the commits API before creating the ref.

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="${FULL_SHA}"

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.
@B4nan B4nan added the adhoc Ad-hoc unplanned task added during the sprint. label Jul 2, 2026
@B4nan
B4nan merged commit f567891 into main Jul 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants