actions / cache

Cache dependencies and build outputs in GitHub Actions
MIT License
4.51k stars 1.2k forks source link

Bug: Permission is missing in cache delete example #1123

Closed kotokaze closed 1 year ago

kotokaze commented 1 year ago

Add permission to delete cache with gh-actions-cache

Description

According to the API documentation, actions:write permission is at least required. ( Referred to https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id )

Motivation and Context

My action based on the example has failed to delete with ERROR: Resource not accessible by integration. Log: https://github.com/kotokaze/texlive/actions/runs/4272709474/jobs/7438088882

image

How Has This Been Tested?

The action deleted caches as expected by adding actions:write permission Log: https://github.com/kotokaze/texlive/actions/runs/4273085511/jobs/7438755085

Types of changes

Checklist: