gh-get-current-pr icon indicating copy to clipboard operation
gh-get-current-pr copied to clipboard

Resource not accessible by integration

Open patrickelectric opened this issue 1 year ago • 2 comments

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)"

image

Expected behaviour

To fetch the current PR

Actual behaviour

It's failing

patrickelectric avatar Apr 29 '23 11:04 patrickelectric

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

roman-parkhunovskyi avatar May 01 '23 16:05 roman-parkhunovskyi

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 }}.

dargmuesli avatar Oct 16 '23 17:10 dargmuesli

where are you supposed to make these changes?

nnamacha avatar Oct 01 '24 05:10 nnamacha