Skip to content

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

@iamazeem

Description

@iamazeem

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions