I published a private package to my organizations github repository. When I try to deploy a lambda through github actions that uses this package, I get an error saying "fatal: could not read Username for 'https://github.com': terminal prompts disabled Confirm the import path was entered correctly." Is there an extra line that I need to add to my yml file or would this permission need to be given in the package itself?
I think you should Configure git for private modules
in the GitHub action, adding one simple step in your workflow, like:
- name: Configure git for private modules
env:
GITHUB_API_TOKEN: ${{ secrets.GH_API_TOKEN }}
run: git config --global url."https://x:${GITHUB_API_TOKEN}@github.com".insteadOf "https://github.com"
And add the GH_API_TOKEN
secrets in the repo in order to be able to download the go modules during build step, like the go mod tidy
command.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.