-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add copilot instructions and setup steps #4884
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
base: master
Are you sure you want to change the base?
Conversation
# Set the permissions to the lowest permissions possible needed for your steps. | ||
# Copilot will be given its own token for its operations. | ||
permissions: | ||
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete. | ||
contents: write # TEST: `uv` wasn't installed after the workflow succeded, maybe this is needed? | ||
pull-requests: write # So copilot can add labels to the 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.
there is another security finding here - I don't understand why it doesn't show in the PR as comment … https://github.com/python-telegram-bot/python-telegram-bot/security/code-scanning/120
Looking at https://docs.github.com/en/rest/authentication/permissions-required-for-github-apps?apiVersion=2022-11-28#repository-permissions-for-contents it does indeed look like contents-write should be avoided. I don't quite understand your comment either, tbh 😅
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 don't quite understand your comment either
So what happened was the uv was installed in the environment at the end of that workflow but when copilot tried to access it via uv
, there was no uv binary to be found anywhere in the filesystem. So I thought changing this to "write" might fix that. Probably not, but it might be worth a try?
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.
Well, if you can confirm that this helps, I'm open to adding it. My understanding however is that contents: write
means that the workflow is allowed to make changes in the git repo itself, not in the workflow-environment.
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 don't think I can tell @copilot to edit a file in this branch.. which means I don't have a way of testing it here. So I'll just revert for now and see what happens
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.
Thanks for your patience :) if there's nothing left from your side I can merge
Spinoff from #4875