Skip to content

Commit

Permalink
Expand GHA go caching to includ newest release branch (#10307)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Nola <derek.nola@suse.com>
  • Loading branch information
dereknola committed Jun 6, 2024
1 parent d9b8ba8 commit cff6f7a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/actions/setup-go/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ runs:
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod' # Just use whatever version is in the go.mod file
cache: ${{ github.ref == 'refs/heads/master' }}
cache: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/release-1.29' }}

- name: Prepare for go cache
if: ${{ github.ref != 'refs/heads/master' }}
if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/release-1.29' }}
shell: bash
run: |
echo "GO_CACHE=$(go env GOCACHE)" | tee -a "$GITHUB_ENV"
echo "GO_MODCACHE=$(go env GOMODCACHE)" | tee -a "$GITHUB_ENV"
echo "GO_VERSION=$(go env GOVERSION | tr -d 'go')" | tee -a "$GITHUB_ENV"
- name: Setup read-only cache
if: ${{ github.ref != 'refs/heads/master' }}
if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/release-1.29' }}
uses: actions/cache/restore@v4
with:
path: |
Expand Down

0 comments on commit cff6f7a

Please sign in to comment.