Skip to content

fix: normalize binary cache path so the save step works#7

Merged
hhvrc merged 3 commits into
masterfrom
fix/cache-path-normalize
Jun 25, 2026
Merged

fix: normalize binary cache path so the save step works#7
hhvrc merged 3 commits into
masterfrom
fix/cache-path-normalize

Conversation

@hhvrc

@hhvrc hhvrc commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Problem

The binary cache added in #6 never populated. The post-save step failed with:

[warning]Invalid pattern '/home/runner/work/release-tool/release-tool/.//release-tool'.
Relative pathing '.' and '..' is not allowed.

For uses: ./ (this repo's own release/check-changes self-invocation), github.action_path ends in /., so ${{ github.action_path }}/release-tool contained /./, which actions/cache rejects. The restore just reported a miss, so it looked like caching simply never worked.

Fix

Derive a normalized absolute path with pwd -P in the hash step and use it as the cache path. Build output and the run binary already resolve to the same physical file, so only the cache path input needed the clean form. External SHA-pinned consumers were unaffected (no trailing /.), but this makes it correct everywhere.

Testing

  • action.yml validated as YAML.
  • pwd -P from the action dir yields a clean path with no /./.
  • Built binary still produces Next version: 1.6.0 against the Firmware repo.

Open in Stage

hhvrc added 2 commits June 25, 2026 12:29
go run . recompiled the tool on every invocation (~15s) and setup-go's
module cache never worked: its cache-dependency-path is the action's
go.sum under _actions/, outside GITHUB_WORKSPACE, so the cache key could
not resolve. Build the binary once and cache it keyed on a content hash
of the Go sources (correct for both SHA-pinned consumers and the repo's
own uses: ./ self-invocation), skipping Go setup and compilation on a
cache hit.
github.action_path ends in /. for local (uses: ./) invocation, so the
cache path contained /./ and actions/cache rejected it as an invalid
pattern in the post save step ("Relative pathing '.' and '..' is not
allowed"), silently skipping the save so the cache never populated.
Derive a normalized absolute path with pwd -P for the cache path input.
@stage-review

stage-review Bot commented Jun 25, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 2 individual chapters for you:

Title
1 Normalize binary cache path in action.yml
2 Document cache path fix in changelog
Open in Stage

Chapters generated by Stage for commit 8faabdb on Jun 25, 2026 10:43am UTC.

@github-actions

Copy link
Copy Markdown
Contributor

Change file check

OK — 2 valid change file(s) added in this PR.

@hhvrc hhvrc merged commit ca6ddd7 into master Jun 25, 2026
7 checks passed
@hhvrc hhvrc deleted the fix/cache-path-normalize branch June 25, 2026 10:45
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