-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Can GITHUB_TOKEN be used in place of PAT (github update) #147
Comments
spoiler alert it seems it does work as expected 👍 |
Hi @dhruvCW I saw that blog post, too. Thank you for testing it! I've not had chance to test it myself yet, but my guess is that there are still situations where you might need a PAT. For example, if the dispatch is to a remote repository, not the local one associated with the |
Heya! Just wanted to chime in here and also confirm that it seems to work as expected with a |
Just to throw my 2 cents here, I found that I was able to run using the
This will only work for the local repository though. If you want to call a remote repo, you have to use a classic PAT. (The new fine-grained PATs won't work until GitHub adds support for them in the GraphQL API) |
When I tried to do this, I unfortunately have had a bit less luck. I tried passing the We previously had it working with a PAT_TOKEN, which we can certainly switch back to, I just thought this might be a bit nicer (and would stop claiming everything was being done on behalf of the PAT_TOKEN owner). |
@geemus 3 weeks ago I was here and attempted @terrabitz 's solution which worked fine on a public repository. Today I was doing the same for a PRIVATE repository and encountered your problem. It looks like this specifically doesn't work for PRIVATE repositories. My guess is the issued The only way it works with a private repository is by using PAT from a bot. @peter-evans The way to reproduce this is by going to the GraphQL Explorer and typing this:
When logging into the GQL Explorer be sure to be a member of an organization which does not allow the GraphQL API Client access. After executing the query against an organization to whom you are a member and have allowed access you will get something like this:
But when you query an organization which you have not allowed GraphQL to query you will get something like this:
What's interesting is that public repositories work just fine (here's an example of s3fs-nio where we're using it with |
@steve-todorov thanks for the detailed additional info, I was definitely also trying to do this on a private repo when I saw the issue as you had surmised. |
We created a GitHub App and used https://github.com/tibdex/github-app-token to generate a new GITHUB_TOKEN to use in the rest of our workflow. That GitHub App was then granted the necessary roles/permissions to do what it needed. The downside is that we had to feed a secret (the private_key value) into the action via an org-level secret. But it was easy enough to then use the generated token in the rest of the workflow's steps. The step after using
|
Hi love this action 🍻
based on this post from github https://github.blog/changelog/2022-09-08-github-actions-use-github_token-with-workflow_dispatch-and-repository_dispatch/
I was wondering does this mean its possible to use this action entirely with just the
GITHUB_TOKEN
secret and no longer require a PAT ?The text was updated successfully, but these errors were encountered: