peter-evans / create-pull-request

A GitHub action to create a pull request for changes to your repository in the actions workspace
MIT License
2.11k stars 411 forks source link

Auto add label not work when push-to-fork #1296

Closed axmol-bot closed 1 year ago

axmol-bot commented 1 year ago

Subject of the issue

Auto add label not work when push-to-fork.

Steps to reproduce

https://github.com/axmolengine/axmol/blob/dev/.github/workflows/update-prebuilts.yml

If this issue is describing a possible bug please provide (or link to) your GitHub Actions workflow.

peter-evans commented 1 year ago

Hi @axmol-bot

It looks like this is a permissions issue. Make sure that the user account that the AX_BOT_TOKEN token is created on has permission to create and apply labels.

image

peter-evans commented 1 year ago

@axmol-bot

I've just realised that my reply doesn't make much sense if you are intentionally using push-to-fork so that you don't need to give the account access to the main repository. In this case, it's expected that applying labels will fail. In fact, all of the following inputs will fail to be applied because they require write access to the repository: labels, assignees, reviewers, team-reviewers and milestone.

To make this more clear I'm going to update the documentation for push-to-fork and maybe improve the error handling/messaging for applying these inputs.

peter-evans commented 1 year ago

Updated the docs: https://github.com/peter-evans/create-pull-request/commit/6c704eb7a8ba1daa13da0dcea9bb93a4fe530275

axmol-bot commented 1 year ago

Thanks, nice work.

axmol-bot commented 1 year ago

I grant triage access to this bot accout, maybe also works.

peter-evans commented 1 year ago

Looks like that might work. https://docs.github.com/en/organizations/managing-user-access-to-your-organizations-repositories/repository-roles-for-an-organization