GitHub Actions "HTTP 422: Reference does not exist" (create release)
Creating a release ties it to a tag at a commit. If the tag does not exist (or target_commitish points at a ref that is not present), the API rejects it with HTTP 422 Reference does not exist.
What this error means
A create-release step fails with a 422, usually because the tag was never pushed or the target commitish is wrong.
github-actions
HttpError: Reference does not exist (422)
creating release for tag v1.4.0Common causes
Tag not pushed before release
The release references a tag that does not yet exist in the repo.
Wrong target_commitish
A target branch/SHA that is not present makes the reference invalid.
How to fix it
Create the tag first or let the action create it
- Push the tag before creating the release, or use an action that creates the tag.
- Set target_commitish to a SHA or branch that exists.
- Ensure contents: write permission so the action can create the tag.
.github/workflows/release.yml
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- run: |
git tag v1.4.0
git push origin v1.4.0
- uses: softprops/action-gh-release@v2
with:
tag_name: v1.4.0How to prevent it
- Ensure the tag exists (or is created in the same job) before the release call.
- Grant contents: write for release and tag creation.
Related guides
GitHub Actions default GITHUB_TOKEN is read-only (cannot push)Fix a GitHub Actions push that is denied - the default GITHUB_TOKEN is read-only and needs contents: write to…
GitHub Actions "Resource not accessible by integration" (issues: write missing)Fix "Resource not accessible by integration" when commenting on issues/PRs - the GITHUB_TOKEN lacks issues: w…
GitHub Actions "Pull request is not mergeable" (auto-merge)Fix a GitHub Actions auto-merge step that fails with "Pull request is not mergeable" - branch protection, con…