1010 workflow_dispatch :
1111
1212permissions :
13- contents : read # to fetch code (actions/checkout)
13+ contents : read # to fetch code (actions/checkout)
1414
1515env :
16- # run coverage and benchmarks only with the latest Go version
1716 LATEST_GO_VERSION : " 1.26"
1817
18+ # https://github.com/actions/checkout/commit/df4cb1c069e1874edd31b4311f1884172cec0e10
19+ CHECKOUT_ACTION : &checkout_action actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
20+
21+ # https://github.com/actions/setup-go/commit/924ae3a1cded613372ab5595356fb5720e22ba16
22+ SETUP_GO_ACTION : &setup_go_action actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
23+
24+ # https://github.com/codecov/codecov-action/commit/fb8b3582c8e4def4969c97caa2f19720cb33a72f
25+ CODECOV_ACTION : &codecov_action codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7
26+
1927jobs :
2028 test :
2129 strategy :
@@ -30,10 +38,10 @@ jobs:
3038 runs-on : ${{ matrix.os }}
3139 steps :
3240 - name : Checkout Code
33- uses : actions/checkout@v6
41+ uses : *checkout_action
3442
3543 - name : Set up Go ${{ matrix.go }}
36- uses : actions/setup-go@v6
44+ uses : *setup_go_action
3745 with :
3846 go-version : ${{ matrix.go }}
3947
4250
4351 - name : Upload coverage to Codecov
4452 if : success() && matrix.go == env.LATEST_GO_VERSION && matrix.os == 'ubuntu-latest'
45- uses : codecov/codecov-action@v6
53+ uses : *codecov_action
4654 with :
4755 token :
4856 fail_ci_if_error : false
@@ -53,18 +61,18 @@ jobs:
5361 runs-on : ubuntu-latest
5462 steps :
5563 - name : Checkout Code (Previous)
56- uses : actions/checkout@v6
64+ uses : *checkout_action
5765 with :
5866 ref : ${{ github.base_ref }}
5967 path : previous
6068
6169 - name : Checkout Code (New)
62- uses : actions/checkout@v6
70+ uses : *checkout_action
6371 with :
6472 path : new
6573
66- - name : Set up Go ${{ matrix.go }}
67- uses : actions/setup-go@v6
74+ - name : Set up Go
75+ uses : *setup_go_action
6876 with :
6977 go-version : ${{ env.LATEST_GO_VERSION }}
7078
0 commit comments