Skip to content

Commit a149911

Browse files
authored
Fix module cache (#1514)
1 parent 0060df5 commit a149911

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/actions/setup-go/action.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ runs:
2828
shell: bash
2929
id: cache-info
3030
env:
31-
MODULES_KEY: go-modules-${{ runner.os }}-${{ steps.install-go.outputs.go-version }}-${{ hashFiles('**/go.sum', '**/Herebyfile.mjs', '**/.custom-gcl.yml', '**/.dprint.jsonc') }}
32-
LINT_KEY: golangci-lint-${{ runner.os }}-${{ steps.install-go.outputs.go-version }}-${{ hashFiles('**/go.sum', '**/Herebyfile.mjs', '**/.custom-gcl.yml', '**/.dprint.jsonc') }}
31+
MODULES_KEY: go-modules-${{ runner.os }}-${{ steps.install-go.outputs.go-version }}-${{ hashFiles('**/go.sum', '**/.custom-gcl.yml') }}
32+
LINT_KEY: golangci-lint-${{ runner.os }}-${{ steps.install-go.outputs.go-version }}-${{ hashFiles('**/go.sum', '**/.custom-gcl.yml') }}
3333
BUILD_KEY: go-build-cache-${{ runner.os }}-${{ steps.install-go.outputs.go-version }}
3434
run: |
3535
echo "modules-key=$MODULES_KEY" >> $GITHUB_OUTPUT
@@ -41,8 +41,7 @@ runs:
4141
name: Restore Go modules
4242
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
4343
with:
44-
key: unused-key-${{ github.run_id }}
45-
restore-keys: ${{ steps.cache-info.outputs.modules-key }}-
44+
key: ${{ steps.cache-info.outputs.modules-key }}
4645
path: |
4746
~/go/pkg/mod
4847
@@ -77,6 +76,13 @@ runs:
7776
shell: bash
7877
run: npm ci
7978

79+
- if: ${{ inputs.create == 'true' }}
80+
shell: bash
81+
run: |
82+
go mod download
83+
cd _tools
84+
go mod download
85+
8086
- if: ${{ inputs.create == 'true' }}
8187
shell: bash
8288
run: npx hereby build

0 commit comments

Comments
 (0)