Skip to content

Conversation

@harshil21
Copy link
Member

Spinoff from #4875

@harshil21 harshil21 added the ⚙️ ci-cd affected functionality: ci-cd label Jul 28, 2025
Comment on lines 18 to 23
# 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
Copy link
Member

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 😅

Copy link
Member Author

@harshil21 harshil21 Aug 4, 2025

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?

Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

@Bibo-Joshi Bibo-Joshi left a 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

@Bibo-Joshi Bibo-Joshi merged commit 4654d19 into master Aug 8, 2025
10 checks passed
@Bibo-Joshi Bibo-Joshi deleted the copilot-instructions branch August 8, 2025 04:53
@github-actions github-actions bot locked and limited conversation to collaborators Aug 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

⚙️ ci-cd affected functionality: ci-cd

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants