-
Notifications
You must be signed in to change notification settings - Fork 6
Add more permissions #26
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
Add more permissions #26
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the permissions configuration in the smoketest workflow to align with the recommended permissions for the branch-deploy action. It adds several necessary permissions for proper IssueOps functionality.
Key Changes:
- Expanded permissions from 2 to 5 entries to support full branch-deploy capabilities
- Added documentation comment explaining the purpose and source of the permission requirements
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| pull-requests: write # For adding a reaction to the comment | ||
| pull-requests: write # Required for commenting on PRs | ||
| deployments: write # Required for updating deployment statuses | ||
| contents: write # Required for reading/writing the lock file |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The comment states 'reading/writing' but the permission is 'write'. Consider clarifying that 'write' permission includes read access, or simplify to 'Required for writing the lock file' to match the permission level.
| contents: write # Required for reading/writing the lock file | |
| contents: write # Required for writing the lock file |
|
Should we add a check so that only code owners can trigger this? |
| pull-requests: write # For adding a reaction to the comment | ||
| pull-requests: write # Required for commenting on PRs | ||
| deployments: write # Required for updating deployment statuses | ||
| contents: write # Required for reading/writing the lock file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes me wonder if we really need the workflow. On one hand it is carefully reviewed IssueOps, on the other hand it is a potentially untrusted code running with high privileges...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or trigger it only on release or push instead of issue comment? The tests are running on the base code and not head anyway, so I don't see why it should be on issue comment. And if it runs on head then we definitely need to restrict it. It's not very clear to me when we want to run this workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is that the branch-deploy action makes this safe to trigger with an issue comment. It's the solution that we've been recommending to other open source maintainers.
I intended this to run on the code from the PR, not the base code. That was a mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I didn't notice it checkouts the main instead of steps.branch-deploy.outputs.sha. @kevinbackhouse could you remind us what is the purpose of the workflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's for testing that the examples still work. It needs the COPILOT_TOKEN secret so a standard pull-request trigger doesn't work. I figure we could run it on-demand by adding a comment to a PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated it to use github.head_ref.
Add all of these recommended permissions:
https://github.com/github/branch-deploy/blob/48285b12b35e47e2dde0c27d2abb33daa846d98b/README.md?plain=1#L189-L197