Skip to content

Commit 828b6e1

Browse files
authored
fix: Adjust workflow permissions (#1307)
Signed-off-by: Marcelo E. Magallon <marcelo.magallon@grafana.com>
1 parent 130744f commit 828b6e1

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.github/workflows/build_and_publish.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
type: string
77

88
permissions:
9-
contents: none
109
packages: none
1110

1211
jobs:
@@ -15,6 +14,7 @@ jobs:
1514
runs-on: ubuntu-latest
1615
permissions:
1716
contents: read
17+
id-token: none
1818
outputs:
1919
repo_name: ${{ steps.info.outputs.repo_name }}
2020
steps:
@@ -43,6 +43,7 @@ jobs:
4343
runs-on: github-hosted-ubuntu-${{ matrix.arch }}
4444
permissions:
4545
contents: write # needed to upload build artifacts
46+
id-token: none
4647

4748
container:
4849
image: ghcr.io/grafana/grafana-build-tools:v0.40.3@sha256:1e112c01108b888ae64e786e6d13a8e46c02884f94ccf784ad646d906ac97254
@@ -319,6 +320,7 @@ jobs:
319320
runs-on: github-hosted-ubuntu-x64-small
320321
permissions:
321322
contents: read
323+
id-token: none
322324
steps:
323325
# The following two steps are needed because trigger-argo-workflow is
324326
# calling setup-go *after* setup-argo, and setup-argo actually needs go

.github/workflows/build_and_publish_main.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ on:
55
branches:
66
- main
77

8-
# This is needed so that pushing to GAR works.
98
permissions:
109
contents: none
1110
packages: none
1211

1312
jobs:
1413
call_build_and_publish:
14+
permissions:
15+
contents: write # Necessary to publish artifacts
16+
id-token: write # Necessary to publish to GAR
1517
uses: ./.github/workflows/build_and_publish.yaml
1618
with:
1719
mode: dev

.github/workflows/build_and_publish_tag.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ permissions:
1212

1313
jobs:
1414
call_build_and_publish:
15+
permissions:
16+
contents: write # Necessary to publish artifacts
17+
id-token: write # Necessary to publish to GAR
1518
uses: ./.github/workflows/build_and_publish.yaml
1619
with:
1720
mode: prod

0 commit comments

Comments
 (0)