Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix: allow bot to post (#5763)

teo9d6dca9c7338
diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml
index 4b129e503b..d2b463c1c4 100644
--- a/.github/workflows/cla.yml
+++ b/.github/workflows/cla.yml
@@ -17,7 +17,7 @@ jobs:
runs-on: namespace-profile-linux-tiny-no-cache
permissions:
issues: write
- pull-requests: read
+ pull-requests: write
statuses: write
steps:
- name: Run CLA check
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/cla.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/cla.rs
index ba8df2b852..cf4749db0c 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/cla.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/cla.rs
@@ -64,12 +64,15 @@ fn cla_job() -> Job {
"github.event_name == 'pull_request_target' || \
(github.event.issue.pull_request && startsWith(github.event.comment.body, '/macro-cla'))",
))
- // Least privilege for what the script actually calls: commit statuses
- // (write), PR comments and reactions — which are issue APIs even on a
- // PR (write), and `pulls.get` (read only).
+ // `pull_requests` must be WRITE, not read. Posting the invitation goes
+ // through the issues API (`POST /issues/{n}/comments`), but GitHub
+ // scopes that call by the *target resource*: when the target is a PR
+ // it demands `pull_requests=write`, and `issues=write` alone gets a
+ // 403 "Resource not accessible by integration". Do not narrow this
+ // again on the reasoning that PR comments are issue comments.
.permissions(Permissions {
statuses: Some(Level::Write),
- pull_requests: Some(Level::Read),
+ pull_requests: Some(Level::Write),
issues: Some(Level::Write),
..Default::default()
})