Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows: Fix permissions for release-sources job #100750

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

tstellar
Copy link
Collaborator

For reusable workflows, the called workflow cannot upgrade it's permissions, and since the default permission is none, we need to explicitly declare 'contents: read' when calling the release-sources workflow.

Fixes the error:
The workflow is requesting 'contents: read', but is only allowed 'contents: none'.

For reusable workflows, the called workflow cannot upgrade it's
permissions, and since the default permission is none, we need to
explicitly declare 'contents: read' when calling the release-sources
workflow.

Fixes the error:
The workflow is requesting 'contents: read', but is only allowed 'contents: none'.
@llvmbot
Copy link
Member

llvmbot commented Jul 26, 2024

@llvm/pr-subscribers-github-workflow

Author: Tom Stellard (tstellar)

Changes

For reusable workflows, the called workflow cannot upgrade it's permissions, and since the default permission is none, we need to explicitly declare 'contents: read' when calling the release-sources workflow.

Fixes the error:
The workflow is requesting 'contents: read', but is only allowed 'contents: none'.


Full diff: https://github.com/llvm/llvm-project/pull/100750.diff

1 Files Affected:

  • (modified) .github/workflows/release-tasks.yml (+1)
diff --git a/.github/workflows/release-tasks.yml b/.github/workflows/release-tasks.yml
index 2ed56dace1d4c..116261f8e76b7 100644
--- a/.github/workflows/release-tasks.yml
+++ b/.github/workflows/release-tasks.yml
@@ -89,6 +89,7 @@ jobs:
   release-sources:
     name: Package Release Sources
     permissions:
+      contents: read
       id-token: write
       attestations: write
     needs:

@tstellar tstellar force-pushed the release-sources-fix branch from e036e2b to ebc1627 Compare July 26, 2024 14:27
@tstellar tstellar merged commit 82c2259 into llvm:main Aug 7, 2024
10 checks passed
@tstellar tstellar added this to the LLVM 19.X Release milestone Aug 7, 2024
@tstellar
Copy link
Collaborator Author

tstellar commented Aug 7, 2024

/cherry-pick 82c2259

llvmbot pushed a commit to llvmbot/llvm-project that referenced this pull request Aug 7, 2024
For reusable workflows, the called workflow cannot upgrade it's
permissions, and since the default permission is none, we need to
explicitly declare 'contents: read' when calling the release-sources
workflow.

Fixes the error:
The workflow is requesting 'contents: read', but is only allowed
'contents: none'.

(cherry picked from commit 82c2259)
@llvmbot
Copy link
Member

llvmbot commented Aug 7, 2024

/pull-request #102373

tru pushed a commit to llvmbot/llvm-project that referenced this pull request Aug 10, 2024
For reusable workflows, the called workflow cannot upgrade it's
permissions, and since the default permission is none, we need to
explicitly declare 'contents: read' when calling the release-sources
workflow.

Fixes the error:
The workflow is requesting 'contents: read', but is only allowed
'contents: none'.

(cherry picked from commit 82c2259)
kstoimenov pushed a commit to kstoimenov/llvm-project that referenced this pull request Aug 15, 2024
For reusable workflows, the called workflow cannot upgrade it's
permissions, and since the default permission is none, we need to
explicitly declare 'contents: read' when calling the release-sources
workflow.

Fixes the error:
The workflow is requesting 'contents: read', but is only allowed
'contents: none'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

3 participants