ci: add explicit permissions to release-please job#1224
Conversation
Co-Authored-By: Steven Zhang <szhang@launchdarkly.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
@cursor review |
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/js-client-sdk-common size report |
Requirements
N/A — CI-only change, no application code or tests affected.
Related issues
release-please failed: Error adding to tree: bde8e57b3c8b189265cdf83da69ee9eb0943451eDescribe the solution you've provided
The
release-pleasejob in therelease-please.ymlworkflow was failing because itsGITHUB_TOKENonly hadContents: readpermission. The job needscontents: writeto create git trees/commits andpull-requests: writeto update the release PR branch via the GitHub API.The previous successful run (Mar 24) had full write permissions via the repo/org default, but a subsequent change to the default workflow permissions reduced the token to read-only, breaking this job. Other jobs in the same workflow (e.g.,
release-common) were unaffected because they already declare explicitpermissions.This PR adds an explicit
permissionsblock to therelease-pleasejob, matching the pattern used by the other release jobs.Describe alternatives you've considered
Reverting the repository/organization default workflow permissions back to "Read and write" — rejected because explicit per-job permissions follow the principle of least privilege and are more resilient to future settings changes.
Additional context
Human review checklist
contents: write+pull-requests: writeare sufficient forrelease-please-action@v4(the action docs list these as the required permissions)Link to Devin session: https://app.devin.ai/sessions/cb7dde700084447b9b8c4e3e95de65b4
Requested by: @joker23
Note
Medium Risk
Adds
contents: writeandpull-requests: writeto therelease-pleaseworkflow job, slightly increasing CI token privileges but scoped to the release automation path.Overview
Fixes failing automated releases by adding an explicit
permissionsblock to therelease-pleasejob in.github/workflows/release-please.yml, grantingGITHUB_TOKENcontents: writeandpull-requests: writesorelease-please-actioncan create commits/trees and update the release PR.Written by Cursor Bugbot for commit 676b99d. This will update automatically on new commits. Configure here.