News for hackers. Stuff that matters.
Re:Go Modules Cheat Sheet by ramonrue on Monday May 03, 2021 @03:56PM (#27029914)
At least for Gitlab, you can write a .netrc in the user‘s home dir like so:

machine <your GitLab domain> (e.g. gitlab.com) login <your GitLab id> password <your GitLab personal access token>

For the access token, you can also leverage Gitlab‘s CI Job Token.

What we do is an „echo $(netrc contents with $CI_JOB_TOKEN) > ~/.netrc“ in the pre-script in CI.

(https://stackoverflow.com/a/61257782 and https://docs.gitlab.com/ee/security/token_overview.html)

Re:Go Modules Cheat Sheet by morelisp on Monday May 03, 2021 @04:06PM (#27030006)
If you do take this approach, writing your access token in plaintext into a well-known file in your home directory seems like a strictly worse idea than the (also more broadly-compatible) Git insteadof rule to pull via SSH and your local agent.
Re:Go Modules Cheat Sheet by ramonrue on Tuesday May 04, 2021 @03:55AM (#27035002)
Yes, though it should be noted that the access token is only valid for the duration of the Job.