You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"No scope" warning for pull request closed events #129
I get the warning No scopes with read permission were found on the request. if I setup my workflow for triggering on pull request: close.
If I change the trigger to push, it works.
Is the problem that the head_branch of the Pull Request can't read/write to the master's cache?
Ah. But I need my action to trigger on a pull_request event.
Restricting write makes sense. But reads too?
From the docs
Example of search priority
key:
npm-feature-d5ea0750
restore-keys: |
npm-feature-
npm-
For example, if a pull request contains a feature branch (the current scope) and targets the default branch (master), the action searches for key and restore-keys in the following order:
Key npm-feature-d5ea0750 in the feature branch scope
Key npm-feature- in the feature branch scope
Key npm- in the feature branch scope
Key npm-feature-d5ea0750 in the master branch scope
Key npm-d5ea0750 in the master branch scope
Key npm in the master branch scope
Doesn't ☝️ imply that a feature branch would be able to read cache which is in the scope of the master branch?
@SatheeshJM the issue is a mix of scopes and how we determine which events to give write and read access.
For PRs, we validate that the ref is in the form that we expect refs/pulls... (i.e. it's a pull request branch). Since this is a PR Close event and you're not seeing cache permissions, I'd expect this ref to be in some other form.
Can you add @joshmgross to the documentation what events have scope? On "deployment" event does not work either...
So are you saying the default branch's cache will be accessible from other PR events, but PR-close event won't have access, because the ref will be different? @joshmgross
@joshmgross why is a read forbidden? its not mutating things. i have an upstream provider that has been really flaky as of late and the cache saves me lots of breaks.
Activity
joshmgross commentedon Dec 13, 2019
Yep! You'll need to trigger off of a
pushevent to write to the default branch's cache.SatheeshJM commentedon Dec 14, 2019
Ah. But I need my action to trigger on a
pull_requestevent.Restricting write makes sense. But reads too?
From the docs
Doesn't ☝️ imply that a feature branch would be able to read cache which is in the scope of the master branch?
SatheeshJM commentedon Dec 15, 2019
Even if I save master cache during a push event (like mentioned here #79 (comment)), my pull event is not able to read the master cache.
chemitaxis commentedon Dec 15, 2019
Can you add @joshmgross to the documentation what events have scope? On "deployment" event does not work either...
SatheeshJM commentedon Dec 17, 2019
@joshmgross any thoughts?
Essentially my branch is not able to access the default branch scoped cache
joshmgross commentedon Dec 17, 2019
@SatheeshJM the issue is a mix of scopes and how we determine which events to give write and read access.
For PRs, we validate that the ref is in the form that we expect
refs/pulls...(i.e. it's a pull request branch). Since this is a PR Close event and you're not seeing cache permissions, I'd expect this ref to be in some other form.Documentation is here: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache
We may have to modify to specify which types of
pull_requestevents are supported.Tracking that with #63
SatheeshJM commentedon Dec 20, 2019
So are you saying the default branch's cache will be accessible from other PR events, but PR-close event won't have access, because the ref will be different?
@joshmgross
joshmgross commentedon Dec 20, 2019
@SatheeshJM that's the current behavior yes.
Duckle29 commentedon Feb 12, 2020
An update of the docs for that would be nice, as this is currently the only place this behavior is documented :)
klapec commentedon Feb 21, 2020
I'm getting the same error when doing a re-run by clicking the "re-run checks" button after a failed run. Is there anything I can do here?
joshmgross commentedon Feb 21, 2020
Yep we can get this documented.
What event was your original run? Did it work with caching?
If you have a link to the run that would be helpful
klapec commentedon Feb 22, 2020
I can't share the link directly as it is a private repo, but here are the logs for the job that fetches the NPM deps and caches them: https://gist.github.com/klapec/3d62182192afdb29d72142a008b95a02
and here are the logs for the job that's supposed to build the application (and it obviously fails because the dependencies were not loaded from the cache):
https://gist.github.com/klapec/41a988381d1f58e2baa727eca51e2b6a
daniel-white commentedon Feb 28, 2020
@joshmgross why is a read forbidden? its not mutating things. i have an upstream provider that has been really flaky as of late and the cache saves me lots of breaks.
jcornaz commentedon Mar 6, 2020
So if I understand well we cannot use
actions/cachefor pull requests?joshmgross commentedon Mar 6, 2020
No that is not correct. All
pull_requestevents work except for theclosedtype. By default, this event will not trigger workflows. See https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request[-]"No scope" warning for pull request event[/-][+]"No scope" warning for pull request closed events[/+]jcornaz commentedon Mar 6, 2020
Ok. Thanks @joshmgross.
So if all
pull_requestevents are supposed to work, there is a problem. I opened an issue for it: #208.joshmgross commentedon May 29, 2020
The issue of pull request re-runs has been fixed, see #208 for details.
With V2 of this action, all events with a GitHub ref are supported, so this issue should now be fixed. See https://github.com/actions/cache#whats-new for more info.