Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using Github App Token #144

Closed
Shahaed opened this issue Sep 21, 2022 · 1 comment · Fixed by #145
Closed

Allow using Github App Token #144

Shahaed opened this issue Sep 21, 2022 · 1 comment · Fixed by #145
Assignees
Labels
enhancement New feature or request

Comments

@Shahaed
Copy link

Shahaed commented Sep 21, 2022

A token from a Github App can have the same permissions as an admin PAT and is probably more appropriate to use than a PAT. (Github App tokens can be gotten this way: https://github.com/tibdex/github-app-token).

This action currently doesn't support tokens from a Github App (even with the correct permissions) because this line:

IN_MEMORY_CACHE[cache_name] = response["permissions"].get(role.value, False)

checks for the admin property in the permission object in the response which a Github App can't have be true.

I think the easiest way to do this would be by removing the admin check and if someone is using a token with insufficient permissions, fail at that specific api.

@CasperWA CasperWA self-assigned this Sep 21, 2022
@CasperWA CasperWA added the enhancement New feature or request label Sep 21, 2022
@CasperWA
Copy link
Owner

@Shahaed do you have a possibility to test out the currently open PR? It can be tested by changing the version of the action to instead point to cwa/close-144-allow-app-tokens:

uses: CasperWA/push-protected@cwa/close-144-allow-app-tokens
with:
  token: ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants