Skip to content

Add necessary permissions to release issue workflow #79272

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

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

nikic
Copy link
Contributor

@nikic nikic commented Jan 24, 2024

The /cherry-pick command needs issues: write to post a comment on the issue. The /branch command also posts a comment, and also needs pull-requests: write to open a PR.

This should fix the failure encountered at #79253 (comment).

The `/cherry-pick` command needs `issues: write` to post a comment
on the issue. The `/branch` command also posts a comment, and
also needs `pull-requests: write` to open a PR.
@llvmbot
Copy link
Member

llvmbot commented Jan 24, 2024

@llvm/pr-subscribers-github-workflow

Author: Nikita Popov (nikic)

Changes

The /cherry-pick command needs issues: write to post a comment on the issue. The /branch command also posts a comment, and also needs pull-requests: write to open a PR.

This should fix the failure encountered at #79253 (comment).


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

1 Files Affected:

  • (modified) .github/workflows/issue-release-workflow.yml (+5)
diff --git a/.github/workflows/issue-release-workflow.yml b/.github/workflows/issue-release-workflow.yml
index 1f45799af169547..3c089c5465472fc 100644
--- a/.github/workflows/issue-release-workflow.yml
+++ b/.github/workflows/issue-release-workflow.yml
@@ -33,6 +33,8 @@ jobs:
   backport-commits:
     name: Backport Commits
     runs-on: ubuntu-latest
+    permissions:
+      issues: write
     if: >-
       (github.repository == 'llvm/llvm-project') &&
       !startswith(github.event.comment.body, '<!--IGNORE-->') &&
@@ -66,6 +68,9 @@ jobs:
   create-pull-request:
     name: Create Pull Request
     runs-on: ubuntu-latest
+    permissions:
+      issues: write
+      pull-requests: write
     if: >-
       (github.repository == 'llvm/llvm-project') &&
       !startswith(github.event.comment.body, '<!--IGNORE-->') &&

@nikic nikic merged commit 5db2e58 into llvm:main Jan 24, 2024
@nikic nikic deleted the fix-release-workflow-perms branch January 24, 2024 14:42
@nikic
Copy link
Contributor Author

nikic commented Jan 24, 2024

Unfortunately we still get a permission error. I think this is because we're using the wrong token to post the issue comment. I've opened #79300 to pass two separate tokens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants