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

Cannot find private repo while using personal access token #135

Open
cterence opened this issue Oct 7, 2024 · 9 comments
Open

Cannot find private repo while using personal access token #135

cterence opened this issue Oct 7, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@cterence
Copy link

cterence commented Oct 7, 2024

Hello,
I'm trying to use this action with a personal access token because I have a flake input from a private repo that I fetch over HTTPS.
Even though using the same token in a curl yields results and using it in my nix.conf fetches the flake fine as well, passing it to the action returns a 404.
I don't understand what I'm doing wrong. It seems like the action does not use the token when fetching the flakes.
Can someone help me with this please ?

@cole-h
Copy link
Member

cole-h commented Oct 7, 2024

You may be able to get this to work in the meantime by adding it to your nix.conf -- since you're using our nix-installer-action, that should be as simple as adding with: token: ${{ secrets.THE_TOKEN }} to your workflow (of course, in proper YAML).

@cole-h cole-h added the bug Something isn't working label Oct 7, 2024
@cterence
Copy link
Author

cterence commented Oct 7, 2024

Thanks for your suggestion, however I just solved it by adding the token as a nix option.
A successful job run !
This might be a good addition to the README if it's the intended way to pass the access token to the nix command.

@cole-h
Copy link
Member

cole-h commented Oct 7, 2024

I think we (used to?) support a with: token: argument to this action, but that might have gotten forgotten / lost / broken when we transitioned this to a TypeScript-based action.

@cterence
Copy link
Author

cterence commented Oct 7, 2024

I actually use this option in my workflow. The action probably uses it only for the PR creation and does not pass it to the nix command ?

@telometto
Copy link

telometto commented Dec 10, 2024

I actually use this option in my workflow. The action probably uses it only for the PR creation and does not pass it to the nix command ?

I'm actually experiencing the same issue; I tried copying your workflow but it still doesn't work... I don't know if there is any difference, but I am using git+ssh instead of git+https.

Are you using a PAT or a classic token?

@cterence
Copy link
Author

In my case it's a fine-grained token. I precisely had the problem because I was trying to use HTTPS for fetching instead of SSH, so you might have a problem with SSH keys rather than tokens.

@telometto
Copy link

[...] so you might have a problem with SSH keys rather than tokens.

Thanks for the feedback. I think you're right; how did you get around this?

@cterence
Copy link
Author

In your workflow, you'll need your job to have access to an SSH key which has the ability to clone your private repo. Something like this : https://github.com/webfactory/ssh-agent.

@telometto
Copy link

In your workflow, you'll need your job to have access to an SSH key which has the ability to clone your private repo. Something like this : https://github.com/webfactory/ssh-agent.

I managed to find out 😊 I (shamelessly) copied yours and actually added exactly that Action. Again, thanks 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants