Replies: 1 comment
-
|
Hey, did you ever figure out how to make this work? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm in doubt how to ensure that my git repo is set up to use personal access token.
The docs tell me to do:
But I found that I'm always able to check out the repo without passing my PAS, so I suspect act falls back to using my local SSH key?
Here is a simple workflow:
Which I run with:
The checkout runs fine. The problem arise when I attempt to perform any actions that require access to the Git remote:
This fails with:
I then figured I'll try to pass the PSA:
Error committing but checkout still works fine.
Then I did some more reading and found that if you pass
with > tokento the checkout action it will use your PSA:It still fails to commit and push but I can see that the token is obscured with
***and printed out. I also noticed that I'm able to pop theGITHUB_TOKENover in a (gitignored).env. I don't know if it has any adverse affects compared to running with the-sflag, but it is a bit more convenient.I read over on the repo for
actions/checkout@v4:Based on this, I would have expected when the repo was checked out it was configured to fetch with the PAT provided and that the commands under "Commit stuff" would do the same?
After a lot of digging around I came to this workaround:
Key part being that I remove the
originremote and add it again with user and token encoded on the URL. It seemed a bit hacky, but I was ready to move on, when I started thinking about the fact that setting the remote writes the URL which now has my secret token embedded as clear-text into the./git/configfile. So this is a security concern.Could someone guide me on how I'm supposed to set this up?
Beta Was this translation helpful? Give feedback.
All reactions