gr2m / merge-schedule-action

GitHub Action to merge pull requests on a scheduled day
ISC License
143 stars 36 forks source link

HttpError: Resource not accessible by integration #78

Closed AHumanIBelieve closed 1 year ago

AHumanIBelieve commented 1 year ago

I am attempting to use merge-schedule-action to update my webcomic. However the workflow job fails. The description goes like: /schedule 2022-01-02(which is it) But I get an error when it runs the job after creating the pull request.

Run gr[2](https://github.com/AHumanIBelieve/ahumanibelieve.github.io/actions/runs/3817569850/jobs/6493904876#step:2:2)m/merge-schedule-action@v2
  with:
    merge_method: merge
    time_zone: UTC
    require_statuses_success: false
    automerge_fail_label: automerge-fail
  env:
    GITHUB_TOKEN: ***
Handling pull request opened for https://github.com/AHumanIBelieve/ahumanibelieve.github.io/pull/[5](https://github.com/AHumanIBelieve/ahumanibelieve.github.io/actions/runs/3817569850/jobs/6493904876#step:2:4)
Schedule date found: "2022-01-02"
Error: HttpError: Resource not accessible by integration

Is there something I am missing or is it just my repo? Do I need to give it permissions or something? Link to pull request: https://github.com/AHumanIBelieve/ahumanibelieve.github.io/pull/5 Thanks for any help!

AHumanIBelieve commented 1 year ago

UPDATE: At the scheduled time, the job still threw the same error

LucaNerlich commented 1 year ago

@AHumanIBelieve go to your account settings -> developer settings -> create a personal access token with enough rights. Go to your repo -> settings -> secrets -> actions -> "add new repo secrect". Call it "PAT" and add your token created earlier. In your yml replace secret.GITHUB_TOKEN with secret.PAT.

done

AHumanIBelieve commented 1 year ago

I just reinstalled the thing with the button on the github marketplace page, and it worked. That probably set up the secret for us.

EDIT: Thank you! I have sadly moved on from using github pages for my website but I do every come back I will be sure to use this.

martbhell commented 1 year ago

Sorry for hijack.

create a personal access token with enough rights.

What is enough rights? Is this documented somewhere?

And the token should not be the classic style right?

AHumanIBelieve commented 1 year ago

go to your account settings -> developer settings -> create a personal access token with enough rights. Go to your repo -> settings -> secrets -> actions -> "add new repo secrect". Call it "PAT" and add your token created earlier. In your yml replace secret.GITHUB_TOKEN with secret.PAT.

done

Do this, I think, @martbhell

martbhell commented 1 year ago

Yeah. But theres lots of rights one can add.

It's able to comment so partially working at least?

https://github.com/martbhell/martbhell.github.io/pull/32#issuecomment-1519079460

martbhell commented 1 year ago

Sorry for spam. Guess I found the missing permissions as the PR merged!

If someone has a list of the minimum permissions needed that would be nice to reduce scope on the token :)

j2kun commented 7 months ago

+1 to @martbhell's comment: I would like to know what subset of permissions to configure.

gr2m commented 7 months ago

It should be content:write and pull_requests:write