Staging workflow should add the commit hash built on to the version string #286

Open
opened 2026-09-08 14:27:44 +01:00 by Vylpes · 0 comments
Owner

Summary

When the Forgejo Stage workflow packages a staging build, the version string written to src/constants/Version.ts should include the commit that was built, not only the branch/ref name.

Background

Today the package job in .forgejo/workflows/staging.yml sets:

export default '${{ github.REF_NAME }}';

So two builds from the same branch (e.g. release/2.5.0) are indistinguishable in the built binary's version constant.

Desired example: release/2.5.0 (8d018549d8).

Acceptance Criteria

AS a maintainer debugging a staged build
GIVEN the Stage workflow package job runs for a push to develop, release/*, or hotfix/*
WHEN it generates src/constants/Version.ts
THEN the default export is {ref_name} ({short_sha}), where ref_name is the triggering ref (e.g. release/2.5.0) and short_sha is the first 10 characters of the commit SHA checked out for that run

AS a maintainer comparing staged artifacts
GIVEN two consecutive pushes to the same release branch produce two Stage workflow runs
WHEN I inspect the version constant (or the user-facing version derived from it) in each artifact
THEN the version strings differ in the parenthetical commit hash portion

AS a release owner
GIVEN a production build is produced via the publish workflow
WHEN versioning is applied
THEN behavior is unchanged from today (this issue does not alter production semver tagging)

Scope

  • Update the Append Version String step in .forgejo/workflows/staging.yml only
  • Use the workflow commit SHA context available in Forgejo Actions (10-character short form)

Out of scope

  • Changing which branches trigger Stage (other issues)
  • Changing semver in package.json

Notes

  • Format: space before the opening parenthesis, hash lowercase hex, no v prefix added by this change
## Summary When the Forgejo **Stage** workflow packages a staging build, the version string written to `src/constants/Version.ts` should include the commit that was built, not only the branch/ref name. ## Background Today the `package` job in `.forgejo/workflows/staging.yml` sets: ```ts export default '${{ github.REF_NAME }}'; ``` So two builds from the same branch (e.g. `release/2.5.0`) are indistinguishable in the built binary's version constant. Desired example: `release/2.5.0 (8d018549d8)`. ## Acceptance Criteria AS a maintainer debugging a staged build GIVEN the Stage workflow `package` job runs for a push to `develop`, `release/*`, or `hotfix/*` WHEN it generates `src/constants/Version.ts` THEN the default export is `{ref_name} ({short_sha})`, where `ref_name` is the triggering ref (e.g. `release/2.5.0`) and `short_sha` is the first 10 characters of the commit SHA checked out for that run AS a maintainer comparing staged artifacts GIVEN two consecutive pushes to the same release branch produce two Stage workflow runs WHEN I inspect the version constant (or the user-facing version derived from it) in each artifact THEN the version strings differ in the parenthetical commit hash portion AS a release owner GIVEN a production build is produced via the publish workflow WHEN versioning is applied THEN behavior is unchanged from today (this issue does not alter production semver tagging) ## Scope - Update the **Append Version String** step in `.forgejo/workflows/staging.yml` only - Use the workflow commit SHA context available in Forgejo Actions (10-character short form) ## Out of scope - Changing which branches trigger Stage (other issues) - Changing semver in `package.json` ## Notes - Format: space before the opening parenthesis, hash lowercase hex, no `v` prefix added by this change
Vylpes added this to the 2.5.0 milestone 2026-09-08 14:27:48 +01:00
Commenting is not possible because the repository is archived.
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
RabbitLabs/random-bunny#286
No description provided.