Skip to content

Commit 6a8f912

Browse files
authored
[LTS] Fix Github Workflows to Mirror Main (#776)
Update Github Actions workflows to mirror changes done to `main` to address zizmor findings, using the changes from #770 and #772
1 parent 3f33e71 commit 6a8f912

File tree

6 files changed

+23
-6
lines changed

6 files changed

+23
-6
lines changed

.github/workflows/dependabot.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
steps:
2525
- name: Retrieve GitHub App secrets
2626
id: get-secrets
27-
uses: grafana/shared-workflows/actions/get-vault-secrets@get-vault-secrets-v1.0.1
27+
uses: grafana/shared-workflows/actions/get-vault-secrets@97c6f45f01d4bca8a3b1acfe397113ce88858a81
2828
with:
2929
repo_secrets: |
3030
APP_ID=grafana-go-workspace-bot:app-id
@@ -44,6 +44,7 @@ jobs:
4444
repository: ${{ github.event.pull_request.head.repo.full_name }}
4545
ref: ${{ github.event.pull_request.head.ref }}
4646
token: ${{ steps.generate_token.outputs.token }}
47+
persist-credentials: true
4748

4849
- name: Set go version
4950
uses: actions/setup-go@v4

.github/workflows/lts.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ on:
77

88
jobs:
99
test:
10+
permissions:
11+
contents: read
1012
uses: ./.github/workflows/test.yml

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ on:
77

88
jobs:
99
test:
10+
permissions:
11+
contents: read
1012
uses: ./.github/workflows/test.yml

.github/workflows/pr.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
- "lts/*"
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
check:
1114
name: Go Workspace Check
@@ -17,6 +20,8 @@ jobs:
1720
steps:
1821
- name: Checkout repository
1922
uses: actions/checkout@v4
23+
with:
24+
persist-credentials: false
2025

2126
- name: Set go version
2227
uses: actions/setup-go@v5
@@ -42,14 +47,15 @@ jobs:
4247
uses: actions/checkout@v3
4348
with:
4449
fetch-depth: 0
50+
persist-credentials: false
4551
# go env
4652
- name: Set up Go
4753
uses: actions/setup-go@v5
4854
with:
4955
go-version-file: 'go.mod'
5056
# make lint
5157
- name: Lint
52-
uses: golangci/golangci-lint-action@v3
58+
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc
5359
with:
5460
version: v1.64.5
5561
only-new-issues: true

.github/workflows/release.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ on:
55
tags:
66
- 'v*'
77

8-
permissions:
9-
contents: write
10-
118
jobs:
129
test:
10+
permissions:
11+
contents: read
1312
uses: ./.github/workflows/test.yml
1413
release:
14+
permissions:
15+
contents: write
1516
needs: ['test']
1617
runs-on: ubuntu-latest
1718
steps:
@@ -20,14 +21,16 @@ jobs:
2021
uses: actions/checkout@v4
2122
with:
2223
fetch-depth: 0
24+
persist-credentials: false
2325
# Go env
2426
- name: Set up Go
2527
uses: actions/setup-go@v5
2628
with:
2729
go-version-file: 'go.mod'
30+
cache: false
2831
# Release
2932
- name: Create Release
30-
uses: goreleaser/goreleaser-action@v4
33+
uses: goreleaser/goreleaser-action@5fdedb94abba051217030cc86d4523cf3f02243d
3134
with:
3235
distribution: goreleaser
3336
version: latest

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
uses: actions/checkout@v3
1313
with:
1414
fetch-depth: 0
15+
persist-credentials: false
1516
# go env
1617
- name: Set up Go
1718
uses: actions/setup-go@v5
@@ -29,6 +30,7 @@ jobs:
2930
uses: actions/checkout@v3
3031
with:
3132
fetch-depth: 0
33+
persist-credentials: false
3234
# go env
3335
- name: Set up Go
3436
uses: actions/setup-go@v5
@@ -49,6 +51,7 @@ jobs:
4951
with:
5052
fetch-depth: 0
5153
path: 'grafana-app-sdk'
54+
persist-credentials: false
5255
# Go env
5356
- name: Set up Go
5457
uses: actions/setup-go@v5

0 commit comments

Comments
 (0)