gh-get-current-pr
gh-get-current-pr copied to clipboard
Resource not accessible by integration
Subject of the issue
The action is not working
Your git environment
I have a step that is like that:
- name: Fetch PR
if: ${{ github.event.pull_request }}
uses: 8BitJonny/[email protected]
- name: Rebase PR with target
if: ${{ github.event.pull_request }}
run: |
git rebase $GITHUB_BASE_REF
git log $GITHUB_BASE_REF..HEAD --pretty=format:"%h - %s (%an)"
Expected behaviour
To fetch the current PR
Actual behaviour
It's failing
Confirm. In my workflow there are permissions defined as follows:
permissions:
id-token: write
contents: read
then
steps:
- id: PR
uses: 8BitJonny/[email protected]
with:
sha: ${{ github.event.pull_request.head.sha }}
# github-token: ${{ secrets.GITHUB_TOKEN }} - didn't work as well
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Neither passing GITHUB_TOKEN
env nor github-token works, with the same outcome.
Update: Seems to be working after adding another permission:
pull-requests: read
Are your repositories on which this issue occurs private by any chance?
Edit: pull-requests: read
was the only permission I had to set, even on a private repository. I was able to define this permission on the specific job only without the need to set it per workflow. I also added github-token: ${{ github.token }}
.
where are you supposed to make these changes?