Skip to content

Fix setup-go cache configuration to avoid invalid path pattern#71

Draft
Claude wants to merge 2 commits intomainfrom
claude/fix-setup-go-cache-issue
Draft

Fix setup-go cache configuration to avoid invalid path pattern#71
Claude wants to merge 2 commits intomainfrom
claude/fix-setup-go-cache-issue

Conversation

@Claude
Copy link

@Claude Claude AI commented Mar 9, 2026

The setup-go action was generating a cache restoration warning due to an invalid path pattern caused by concatenating github.action_path with /go.sum, resulting in paths like /home/runner/work/workbench/workbench/.//go.sum.

Changes

  • Replaced cache-dependency-path: ${{ github.action_path }}/go.sum with cache: true and cache-dependency-path: go.sum
  • The action now resolves the go.sum path from the working directory without problematic path concatenation
- name: Set up Go
  uses: actions/setup-go@v6
  with:
    go-version: '1.24.3'
    cache: true
    cache-dependency-path: go.sum

This eliminates the "Relative pathing '.' and '..' is not allowed" warning while maintaining proper Go module caching.

Changed from using `cache-dependency-path: ${{ github.action_path }}/go.sum`
to `cache: true` and `cache-dependency-path: go.sum` to avoid the double
slash issue that was causing the warning:
"Invalid pattern '/path/.//go.sum'. Relative pathing '.' and '..' is not allowed."

The cache will now use the go.sum file from the working directory without
the problematic path concatenation.

Co-authored-by: tcarmet <8408330+tcarmet@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] Fix misconfigured cache for setup-go action Fix setup-go cache configuration to avoid invalid path pattern Mar 9, 2026
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.

2 participants