File tree 5 files changed +33
-20
lines changed
5 files changed +33
-20
lines changed Original file line number Diff line number Diff line change @@ -14,30 +14,34 @@ jobs:
14
14
buildPR :
15
15
name : Build PR
16
16
runs-on : ubuntu-latest
17
+ permissions :
18
+ contents : read
17
19
steps :
18
- - uses : actions/checkout@v4
20
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19
21
with :
22
+ persist-credentials : false
20
23
path : ' ./grafana-plugin-sdk-go'
21
- - uses : actions/checkout@v4
24
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22
25
with :
26
+ persist-credentials : false
23
27
repository : ' grafana/grafana'
24
28
path : ' ./grafana'
25
- - uses : actions/setup-go@v5
29
+ - uses : actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # 5.3.0
26
30
with :
27
31
cache : false
28
32
go-version : ' ~1.22'
29
33
check-latest : true
30
34
31
35
- name : Check if branch exists in Grafana
32
36
working-directory : ' ./grafana'
37
+ env :
38
+ BRANCH : ${{ github.head_ref }}
33
39
run : |
34
- if git ls-remote --heads --quiet --exit-code origin ${{ github.head_ref }}
35
- then
36
- echo "Found branch ${{ github.head_ref }} in Grafana"
37
- git fetch origin ${{ github.head_ref }}
38
- git checkout ${{ github.head_ref }}
40
+ if git ls-remote --heads --quiet --exit-code origin "$BRANCH"; then
41
+ echo "Found branch $BRANCH in Grafana"
42
+ git fetch origin "$BRANCH" && git checkout "$BRANCH"
39
43
else
40
- echo "Branch ${{ github.head_ref }} not found in Grafana"
44
+ echo "Branch $BRANCH not found in Grafana"
41
45
fi
42
46
43
47
- name : Link sdk
Original file line number Diff line number Diff line change 14
14
jobs :
15
15
main :
16
16
runs-on : ubuntu-latest
17
+ permissions :
18
+ contents : read
17
19
steps :
18
- - uses : actions/checkout@v4
20
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19
21
with :
22
+ persist-credentials : false
20
23
path : ' ./grafana-plugin-sdk-go'
21
- - uses : actions/setup-go@v5
24
+ - uses : actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # 5.3.0
22
25
with :
23
26
cache : false
24
27
check-latest : true
Original file line number Diff line number Diff line change @@ -18,24 +18,26 @@ jobs:
18
18
runs-on : ubuntu-latest
19
19
steps :
20
20
- name : Checkout
21
- uses : actions/checkout@v4
21
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22
+ with :
23
+ persist-credentials : false
22
24
23
25
- name : Setup go
24
- uses : actions/setup-go@v5
26
+ uses : actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # 5.3.0
25
27
with :
26
28
go-version-file : ./go.mod
27
29
28
30
- name : Run golangci-lint
29
- uses : golangci/golangci-lint-action@v6
31
+ uses : golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
30
32
with :
31
- version : ${{env. GOLANGCI_LINT_VERSION} }
33
+ version : ${GOLANGCI_LINT_VERSION}
32
34
args : |
33
35
"./..." --timeout=7m
34
36
skip-cache : true
35
37
install-mode : binary
36
38
37
39
- name : Setup Mage
38
- uses : magefile/mage-action@v3
40
+ uses : magefile/mage-action@6f50bbb8ea47d56e62dee92392788acbc8192d0b # v3
39
41
with :
40
42
install-only : true
41
43
Original file line number Diff line number Diff line change 9
9
stale :
10
10
runs-on : ubuntu-latest
11
11
steps :
12
- - uses : actions/stale@v9
12
+ - uses : actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9
13
13
with :
14
14
# Number of days of inactivity before a stale Issue or Pull Request is closed.
15
15
# Set to -1 to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
Original file line number Diff line number Diff line change 12
12
jobs :
13
13
main :
14
14
runs-on : ubuntu-latest
15
+ permissions :
16
+ contents : read
15
17
steps :
16
18
# Run `git checkout`
17
- - uses : actions/checkout@v2
19
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20
+ with :
21
+ persist-credentials : false
18
22
# Install the `buf` CLI
19
- - uses : bufbuild/buf-setup-action@v1
23
+ - uses : bufbuild/buf-setup-action@a47c93e0b1648d5651a065437926377d060baa99 # v1.50.0
20
24
# Perform breaking change detection against the `proto` directory in the `main` branch
21
- - uses : bufbuild/buf-breaking-action@v1
25
+ - uses : bufbuild/buf-breaking-action@c57b3d842a5c3f3b454756ef65305a50a587c5ba # v1.1.4
22
26
with :
23
27
input : ' proto'
24
28
against : ' https://github.com/grafana/grafana-plugin-sdk-go.git#branch=main,subdir=proto'
You can’t perform that action at this time.
0 commit comments