Skip to content
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

chore: Set permissions for clear-pr-caches workflow #4081

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

KapJI
Copy link
Contributor

@KapJI KapJI commented Nov 11, 2024

It seems write permission can't be set on job level, but can be set on workflow level, similar to how lock-threads does this.

@twpayne twpayne merged commit 172aeb6 into twpayne:master Nov 11, 2024
21 checks passed
@KapJI KapJI deleted the fix-clear-caches-2 branch November 11, 2024 12:58
@twpayne
Copy link
Owner

twpayne commented Nov 11, 2024

Thanks for the speedy fix! I'll keep an eye on the jobs and report back.

@KapJI
Copy link
Contributor Author

KapJI commented Nov 11, 2024

It seems it's more complicated.

This run correctly got actions: write permission: https://github.com/twpayne/chezmoi/actions/runs/11779026623/job/32806621771

Even though it was set on job level before this fix.

This run after the fix didn't get it: https://github.com/twpayne/chezmoi/actions/runs/11779169579/workflow

I think in the first case workflow runs in context of this repository, in the failing case it ran in context of my fork which doesn't get write permissions. Probably changing trigger to pull_request_target may help.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants