Permissions of skipped jobs still necessary on calling job #155062
Unanswered
steilerDev
asked this question in
Code Security
Replies: 1 comment
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Select Topic Area
Bug
Body
Based on a CodeQL report, I've recently reduced permission scope of my jobs. Unfortunately it seems that permissions of the calling job are still required, even though the jobs requiring the permissions are skipped.
For now I'm working around this problem by increasing the scope of the permissions, but I'd like to limit permissions scope as narrowly as possible.
Details
I've got a workflow that triggers on every PR as well as one that triggers on every push - both of them call a "Build and release" workflow with different parameters:
release = falserelease = trueDepending on this parameter, the release jobs in the Build and Release workflow will be skipped - the build jobs that are always triggered (1, 2 & 3) don't require any permissions, however the release workflows (1, 2, 3 & 4) (which will only be triggered if
release = true) need various permissions.To reduce the permission scope as much as possible, I therefore wanted to remove all permissions from the PR workflow and only apply the necessary permissions on the Push Workflow.
Unfortunately with this setup calling the Build and Release workflow from the PR workflow fails with:
It seems permission analysis is done statically and is not allowing dynamic permissions. Is this the intended behaviour?
All reactions