fix(lock-closed): grant discussions write permission#399
Conversation
dessant/lock-threads locks inactive discussions by default (discussion-inactive-days: 365). Reusable workflows use their own permissions block (overriding what the caller passes down), and this one omitted discussions: write, so the action failed with "Resource not accessible by integration" when reaching the discussion-locking step. Callers already grant discussions: write, confirming the intent. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe lock-closed GitHub Actions workflow now includes write permission for GitHub Discussions. This single-line change grants the workflow the ability to lock or modify discussions, alongside its existing permissions for issues and pull requests. ChangesDiscussions Write Permission
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…2026-05-29) ### Bug Fixes * **deps:** pin dessant/lock-threads to v6.0.2 ([9705d8f](9705d8f)) * **lint:** hide package.json from npm so actionlint works with pnpm catalog: refs ([1dc687e](1dc687e)) * **lock-closed:** grant discussions write permission ([#399](#399)) ([fb949a5](fb949a5)) ### Miscellaneous Chores * **deps:** apply pnpm audit fixes and dedupe ([dc2b7bc](dc2b7bc))
Summary
The shared
lock-closed.ymlreusable workflow fails withError: Resource not accessible by integrationwhendessant/lock-threadsreaches its discussion-locking step.Root cause:
dessant/lock-threads@v6defaultsdiscussion-inactive-days: 365, so it always attempts to lock inactive discussions. Reusable workflows use their own top-levelpermissions:block (which overrides the permissions the caller passes down), and this workflow declared onlyissues: write+pull-requests: write. Thediscussions: writescope the callers grant (e.g.lock-issues.yaml) was therefore stripped, so the discussion API call was unauthorized.Fix: add
discussions: "write"to the reusable workflow'spermissions:block, matching the intent already expressed by every caller.Test plan
Summary by CodeRabbit