-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
[Docs]: How to use a fine-grained PAT? #557
Comments
Hi @JakobHavtorn and thanks for the issue. Does the token have access to the remote repository? The token has also a setting related to repository access. |
Hi @AndreasAugustin, yes it has access (only) to the two (remote) template repositories that we want to sync towards, via the "Only select repositories" option. And this includes the |
Encountered the same issue with PATs:
I set the token permissions for |
Hi @davidsnyder and thanks for the heads up. @JakobHavtorn super sorry for not getting to work on this issue. Needed to prio some of my actual work tasks |
Both are private |
thanks for the answer. Just made a test -> I am able to use a classic PAT without issues.
Update |
@JakobHavtorn just tested a fine grained PAT with the following settings: it is working (please be aware that I gave permissions to both source and target repo) repo permissions:
also settings set like for classic PAT within source repo (currently not sure if needed). Would be nice if you could test this. |
Thanks @AndreasAugustin! I'll check it tomorrow. I'll try to make a PR with an update to the docs this week 🙌 |
For some reason I still can't get this to work. I made several changes related to the fine grained PAT permissions because I thought that was the problem (for example, if you're trying to clone a template repo owned by an org, I believe the org needs to be the owner of the PAT, not your personal account) Once I have the PAT, if I open a private terminal session and run:
But when I run the plugin as a Github Action it prints
which shows that it logged in successfully via
which is the same error as before (I enabled -x so it would print the command) as if it doesn't have access to view the private repo. Seeing as it's the same GITHUB_TOKEN, and the login procedure is the same, I don't understand how the behavior could be different. My workflow file is
|
Finally figured it out after looking here: https://github.com/orgs/community/discussions/25240 Had to add
When you update the docs, maybe add a note about this! |
Hi @davidsnyder , Remark: |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Unfortunately, I'm not sure either! But I tried everything I could think of and it started working only after I added |
Got it working ❤️ If you are automatically adding reviewers to your pr and using the permissions:
I ran into the error:
I found this issue for it and the error message should have been something like this.
I added |
Describe the documentation issue
In the section on using a PAT to authorise the Action (https://github.com/AndreasAugustin/actions-template-sync?tab=readme-ov-file#3-using-a-pat) there is an example of using a "classic" token, but not one for the new "fine-grained" token type.
We are struggling to create a fine-grained token to give the Action the permissions it needs. We have tried with the below permissions, but get following error during the
action-template-sync
step of the Action:We have previously had the action running with a classic token with the following permissions:
Links
https://github.com/AndreasAugustin/actions-template-sync?tab=readme-ov-file#3-using-a-pat
Acknowledgements
The text was updated successfully, but these errors were encountered: