Skip to content

Commit 71c3b69

Browse files
authored
Fix read contents CI permissions (#61)
## Why is this change necessary? Read contents permission is lost when redefining permissions explicitly, so any private repos fail to be able to checkout code ## How does this change address the issue? explicitly grants read contents permission wherever permissions are redefined and it's needed ## What side effects does this change have? none ## How is this change tested? downstream repo
1 parent 5f0bcae commit 71c3b69

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

template/.github/workflows/ci.yaml.jinja

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ env:
1212

1313
permissions:
1414
id-token: write # needed to assume OIDC roles (e.g. for downloading from CodeArtifact)
15+
contents: read # need to explicitly provide this whenever defining permissions because the default value is 'none' for anything not explicitly set when permissions are defined
1516

1617
jobs:
1718
get-values:

template/.github/workflows/publish.yaml.jinja

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414

1515
permissions:
1616
id-token: write # needed to assume OIDC roles (e.g. for downloading from CodeArtifact)
17+
contents: read # need to explicitly provide this whenever defining permissions because the default value is 'none' for anything not explicitly set when permissions are defined
1718

1819
jobs:
1920
get-values:

template/.github/workflows/publish_to_staging.yaml.jinja

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ env:
88
PRE_COMMIT_HOME: ${{ github.workspace }}/.precommit_cache
99

1010
permissions:
11-
id-token: write # needed to assume OIDC roles (e.g. for downloading from CodeArtifact)
11+
id-token: write # needed to assume OIDC roles (e.g. for downloading from CodeArtifact)
12+
contents: read # need to explicitly provide this whenever defining permissions because the default value is 'none' for anything not explicitly set when permissions are defined
1213

1314
jobs:
1415
lint:

0 commit comments

Comments
 (0)