-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
44 lines (41 loc) · 1.29 KB
/
action.yml
File metadata and controls
44 lines (41 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
description: 'Set up Go with dependency caching and private repo support'
inputs:
go-version-file:
description: 'Path to go.mod file for version detection'
required: false
default: 'go.mod'
personal-access-token:
description: 'Personal access token for private repos'
required: false
cache-dependency-path:
description: 'Path to go.sum file for cache key'
required: false
default: 'go.sum'
cache-key:
description: 'A unique key to keep caches for different actions'
required: true
runs:
using: 'composite'
steps:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: ${{ inputs.go-version-file }}
cache: false
- name: Go cache
id: cache-go
uses: actions/cache@v4
env:
cache-name: cache-go
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-gocache-${{ inputs.cache-key }}-${{ hashFiles(inputs.cache-dependency-path) }}
restore-keys: |
${{ runner.os }}-gocache-${{ inputs.cache-key }}
- name: Private repo support
if: ${{ inputs.personal-access-token != '' }}
shell: bash
run: |
git config --global url.https://${{ inputs.personal-access-token }}@github.com/.insteadOf https://github.com/