Skip to content

Add GitHub App auth#263

Closed
ollytheninja wants to merge 2 commits intopeter-evans:mainfrom
ollytheninja:app_auth
Closed

Add GitHub App auth#263
ollytheninja wants to merge 2 commits intopeter-evans:mainfrom
ollytheninja:app_auth

Conversation

@ollytheninja
Copy link

I don't know if this is the cleanest way to do it, but I have a requirement to use a GitHub App rather than a PAT. I have this working as a PoC now, planning on using it in anger before I mark it as "ready for review" but open to feedback / improvements :)

@peter-evans
Copy link
Owner

Hi @ollytheninja

Apologies for the slow response.

I would rather not add this support directly into the action. Please see this guidance for how to use GitHub app auth to generate tokens. It's documentation for a different action, but the same method applies for any actions where you want to use GitHub app auth.
https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens

@peter-evans peter-evans closed this Sep 4, 2023
@martinm82
Copy link

@peter-evans I am wondering how the action can actually work with a GitHub App. I have been testing this now for some time and cannot figure out how to get it working.

I believe that this will not work because the function here https://github.com/peter-evans/slash-command-dispatch/blob/main/src/github-helper.ts#L62 uses a GraphQL query to query collaborators and those need to be user accounts as far as I know.

This is the debug output of the action with using a GitHub App with really lot of permissions. I even gave it org admin r/w permissions:

##[debug]CollaboratorPermission: []
##[debug]Actor permission: none
##[debug]Actor permission level: 1
##[debug]Command permission level: 4
##[debug]Config matches on 'permission': []
Command 'integrate' is not configured for the user's permission level 'none'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants