Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pages_build_version (GITHUB_SHA) is not unique for events that use last commit e.g. release, workflow_dispatch, etc. #383

Open
iamazeem opened this issue Dec 21, 2024 · 0 comments

Comments

@iamazeem
Copy link

Currently, pages_build_version is always being set using GITHUB_SHA:

buildVersion: process.env.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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant