Fork me on GitHub
#tools-deps
<
2022-06-23
>
Christian Johansen11:06:14

Can tools deps check out private github repos with a personal access token? Specifically, deps.edn has <mailto:[email protected]|[email protected]>:… dependencies, how can I use a personal access token in github actions for tools deps to find the dependencies?

Alex Miller (Clojure team)12:06:33

If you can use git clone outside the Clojure CLI, then it should work

Alex Miller (Clojure team)12:06:47

So solve that problem first

Alex Miller (Clojure team)12:06:04

The CLI is just shelling out to git

Christian Johansen12:06:20

I’ll try to use an SSH key instead, I think that’s easier

Alex Miller (Clojure team)12:06:54

Some of that stuff is set up for you in gh actions

Christian Johansen12:06:50

The checkout thing works with a token, but I’m not sure how to combine it with the tools deps step

Christian Johansen12:06:59

(I’m rather new at github actions…)

Alex Miller (Clojure team)12:06:35

been a while since i used a token - what does that look like? does it get passed on the command line or is it ambient somehow

Christian Johansen12:06:07

I’m not entirely sure 😅 With the checkout action you just specify the token. I think you can use it as a password with your username. Anyway, I got my action pipeline working with an ssh key 👍

practicalli-john14:06:53

Are you sure a token is needed? If an action is within the scope of the current repository, a GITHUB_TOKEN is automatically created for the GitHub action by GitHub. Or you can set a GITHUB_TOKEN environment variable in the repository or the organisation that repository belongs too, usually if you need to update or otherwise affect another repository/ organisation or user.

practicalli-john14:06:16

I assume to access a private repo you can create a token on the private repo and set that as the GITHUB_TOKEN value from the GitHub action that is accessing it (in theory)