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: Fix permissions for clear-pr-caches job #4078

Merged
merged 1 commit into from
Nov 10, 2024

Conversation

KapJI
Copy link
Contributor

@KapJI KapJI commented Nov 10, 2024

DELETE /actions/caches endpoint requires action: write permission.

Failed job: https://github.com/twpayne/chezmoi/actions/runs/11769128068/job/32779753381

@twpayne twpayne merged commit aca64e8 into twpayne:master Nov 10, 2024
21 checks passed
@twpayne
Copy link
Owner

twpayne commented Nov 10, 2024

Thanks!

@KapJI KapJI deleted the fix-clear-caches branch November 10, 2024 23:02
@twpayne
Copy link
Owner

twpayne commented Nov 11, 2024

Hmm, it looks like there's still a problem here: https://github.com/twpayne/chezmoi/actions/runs/11778245494/job/32804280956

@KapJI
Copy link
Contributor Author

KapJI commented Nov 11, 2024

After this change permissions changed from:

GITHUB_TOKEN Permissions
  Actions: read
  Attestations: read
  Checks: read
  Contents: read
  Deployments: read
  Discussions: read
  Issues: read
  Metadata: read
  Packages: read
  Pages: read
  PullRequests: read
  RepositoryProjects: read
  SecurityEvents: read
  Statuses: read

to:

GITHUB_TOKEN Permissions
  Actions: read
  Metadata: read

This is very likely caused by this setting in Settings->Actions->General. It looks like even explicit write permission in job config is not enough and you need to change that setting.
Screenshot 2024-11-11 at 12 42 23

Another option is to remove this workflow and rely on default cache eviction behaviour, this shouldn't be too bad as well.

@KapJI
Copy link
Contributor Author

KapJI commented Nov 11, 2024

It seems there is third option. lock-threads workflow shows that it's possible to set write permissions on workflow level.

Edit: #4081

@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