question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"No scope" warning for pull request closed events

See original GitHub issue

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?

An example config

on:
  pull_request:
    types: 
      - closed
    branches: 
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        ref: master
        fetch-depth: 1
    - name: Cache node modules
      id: cache_node_modules
      uses: actions/cache@v1
      with: 
        path: node_modules
        key: ${{ runner.os }}-node-${{ hashFiles('package.json') }}

for the above config the cache is never used… I get the below warning image

If I tweak the workflow to trigger on branch push, all is well

on:
  push:
    branches: 
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        ref: master
        fetch-depth: 1
    - name: Cache node modules
      id: cache_node_modules
      uses: actions/cache@v1
      with: 
        path: node_modules
        key: ${{ runner.os }}-node-${{ hashFiles('package.json') }}

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jcornazcommented, Mar 6, 2020

Ok. Thanks @joshmgross.

So if all pull_request events are supposed to work, there is a problem. I opened an issue for it: #208.

0reactions
joshmgrosscommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Events that trigger workflows - GitHub Docs
To run a workflow when a pull request merges, use the pull_request closed event type along with a conditional that checks the merged...
Read more >
GitHub Actions Security Best Practices [cheat sheet included]
Actions are triggered by GitHub events (a pull request is submitted, an issue opened, a PR is merged, etc…) and can execute pretty...
Read more >
Repository Hooks and Merge Checks Guide
Scopes determine which levels a hook can be enabled and configured at, although all hooks only fire for repository level events (ref changes...
Read more >
Merge requests - GitLab Docs
Following the comment box, select Close merge request. GitLab closes the merge request, but preserves records of the merge request, its comments, and...
Read more >
Dynamic Admission Control | Kubernetes
The webhook handles the AdmissionReview request sent by the API servers, and sends back its ... means that there are no scope restrictions....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found