Skip to content

fix: sanitize version string for PR Windows builds#13

Merged
sparshsam merged 1 commit into
mainfrom
fix/pr-windows-build-version
Jun 11, 2026
Merged

fix: sanitize version string for PR Windows builds#13
sparshsam merged 1 commit into
mainfrom
fix/pr-windows-build-version

Conversation

@sparshsam

Copy link
Copy Markdown
Owner

Root Cause

On pull_request events, GitHub Actions checks out the auto-generated merge ref (refs/pull/N/merge), making GITHUB_REF_NAME resolve to 12/merge instead of the actual branch name. The version injection logic used this raw ref name directly:

VERSION="${GITHUB_REF_NAME}-test"  # → "12/merge-test"

This version string containing / was passed to Inno Setup's OutputBaseFileName, which is a filename directive — / is invalid, causing ISCC to fail with:

Error: Value of [Setup] section directive "OutputBaseFileName" is invalid.

This only affected the pull_request trigger because push events use the branch ref (refs/heads/mainGITHUB_REF_NAME=main).

Fix

Use GITHUB_HEAD_REF (the actual PR source branch, e.g. docs/post-v1.0.6-doc-review) as the version source for pull_request events, falling back to GITHUB_REF_NAME for push events. Also sanitize /- as a safety net.

Files Changed

  • .github/workflows/build-windows.yml — 2 lines added, 1 removed

Verification

CI will run on this PR. The Build Windows EXE / build (pull_request) check should now pass.

Author Note

Commit is authored as Sparsh Sam <sparshsam@gmail.com> (correct GitHub identity). The previous documentation commit on main (4b6a4e3) was authored with a Git Bash local identity (sparsh@users.noreply.github.com) that resolved to the wrong GitHub user — that commit cannot be re-authored without rewriting main history, which was explicitly avoided here.

On pull_request events, GitHub Actions checks out the merge ref
(pull/N/merge), making GITHUB_REF_NAME resolve to 'N/merge'. The
version injection logic used this raw ref name as-is, producing
version strings like '12/merge-test'. The '/' character is invalid
in Inno Setup's OutputBaseFileName, causing ISCC to fail with:
  Value of [Setup] section directive 'OutputBaseFileName' is invalid.

Fix: use GITHUB_HEAD_REF (the actual PR branch name) as the version
source when building from a pull_request event, falling back to
GITHUB_REF_NAME for push events. Sanitize any remaining '/' for safety.

Also corrects local git identity to Sparsh Sam <sparshsam@gmail.com>
for all future commits.
@sparshsam sparshsam merged commit 65a56c5 into main Jun 11, 2026
6 checks passed
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

Successfully merging this pull request may close these issues.

1 participant