`pages_build_version` (GITHUB_SHA) is not unique for events that use last commit e.g. `release`, `workflow_dispatch`, etc.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- github-actions, javascript
Research direction
Start with src/internal/context.js at line 8 and review how the deployment payload is built, then reproduce the behavior with the provided push, release, and workflow_dispatch workflow. Check the Create a GitHub Pages deployment API requirements and related discussion; done means release and other last-commit events deploy the correct artifact with a unique accepted build version.
Written by the indexing model from the issue text.
Description
Currently, pages_build_version is always being set using GITHUB_SHA:
and, it also represents the deployment ID.
However, for events that use the last commit SHA e.g. release, workflow_dispatch, etc., GITHUB_SHA will not be unique.
Example:
push
Fetching artifact metadata for "github-pages" in this workflow run
Found 1 artifact(s)
Creating Pages deployment with payload:
{
"artifact_id": 2351475241,
"pages_build_version": "ae0b6be8565bc05ecef5aaa6c88c48ac2877ce46",
"oidc_token": "***"
}
Created deployment for ae0b6be8565bc05ecef5aaa6c88c48ac2877ce46, ID: ae0b6be8565bc05ecef5aaa6c88c48ac2877ce46
Getting Pages deployment status...
Reported success!
workflow_dispatch (after push)
Fetching artifact metadata for "github-pages" in this workflow run
Found 1 artifact(s)
Creating Pages deployment with payload:
{
"artifact_id": 2351476924,
"pages_build_version": "ae0b6be8565bc05ecef5aaa6c88c48ac2877ce46",
"oidc_token": "***"
}
Created deployment for ae0b6be8565bc05ecef5aaa6c88c48ac2877ce46, ID: ae0b6be8565bc05ecef5aaa6c88c48ac2877ce46
Getting Pages deployment status...
Reported success!
Observe ID: ae0b6be8565bc05ecef5aaa6c88c48ac2877ce46 in both cases.
Its impact (or side effect) is being observed as that sometimes the artifact is not updated at all.
The previous deployed artifacts is served instead.
Maybe, CDN caching also plays some role here, not sure though.
According to the Create a GitHub Pages deployment API, pages_build_version is supposed to be:
A unique string that represents the version of the build for this deployment.
It is suggested that instead of GITHUB_SHA, artifact_id (or some other unique combination) may be used for pages_build_version (deployment ID).
Let me know if more information is needed. Thanks!
UPDATE 20251116
See https://github.com/actions/deploy-pages/issues/383#issuecomment-3536590513.
Apparently, for release only, this behavior still exists i.e. the correct (latest) artifact is not deployed.
For release and workflow_dispatch, the flow is the same but the release artifact is not updated.
IIRC, at the time of reporting this issue, workflow_dispatch was also not working.
Tried to use a different string such as a timestamp for pages_build_version but Create a GitHub Pages deployment API call resulted in a 404 Not Found failure.
Here's a related discussion about setting pages_build_version other than GITHUB_SHA:
https://github.com/orgs/community/discussions/170184
Here's the workflow I used to reproduce this:
name: github_pages_deployment
on:
push:
branches: [main]
release:
types: [published]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-slim
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- name: Setup
run: |
mkdir _site
cat >"_site/index.html" <<EOF
{
"date": "$(date --utc)",
"github.event_name": "${{ github.event_name }}",
"github.ref_name": "${{ github.ref_name }}",
"github.sha": "${{ github.sha }}"
}
EOF
- name: Upload GitHub Pages artifact
id: upload
uses: actions/upload-pages-artifact@v4
- name: Deploy to GitHub Pages
id: deploy
uses: actions/deploy-pages@v4
- name: Verify
env:
ARTIFACT_ID: ${{ steps.upload.outputs.artifact_id }}
URL: ${{ steps.deploy.outputs.page_url }}
run: |
{
echo "### \`artifact_id\`: \`$ARTIFACT_ID\`"
echo "### curl output:"
echo '```json'
curl -s "$URL" | jq .
echo '```'
} | tee -a "$GITHUB_STEP_SUMMARY"
Sample step summary:
### artifact_id: 4577379444
### curl output:
{
"date": "Sat Nov 15 15:23:41 UTC 2025",
"github.event_name": "push",
"github.ref_name": "main",
"github.sha": "385bffe607ebd2d20c3ab8845b1b652ac48e1312"
}
With this workflow:
- Multiple
pushandworkflow_dispatchevents, consecutive or otherwise, work as expected i.e. correct artifact is deployed. - The
releaseevent uploads and identifies the correct artifact but it's not deployed.- Uploading the
releaseartifact to the release assets also has no effect.
- Uploading the
Workaround
As a workaround after publishing a release, an empty commit may be pushed
git commit --allow-empty -m "Trigger build"
git push
or workflow_dispatch may be added to the deployment workflow to manually trigger it.
- Dominant language
- JavaScript
- Stars
- 967
- Forks
- 147
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from actions/deploy-pages
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
actions/deploy-pages#454 · 1 comment ·
-
Intermittent "No artifacts named github-pages" when deploy-pages runs right after upload-pages-artifact in the same jobPossibly taken @neilime claimed this 7 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 52/100
actions/deploy-pages#451 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
actions/deploy-pages#435 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
actions/deploy-pages#434 · 3 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
actions/deploy-pages#418 · 19 comments · 12 reactions ·
All issues in actions/deploy-pages
Similar issues
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
ai-amazon-bedrock: a tool result that isn't a JSON object fails the next requestPossibly taken @effect-bot claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
[bug] Toolchain versions from `.prototools` are not inherited when moon runs from a subdirectoryOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
check:passed logos:edit
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day