-
Notifications
You must be signed in to change notification settings - Fork 19
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
Credentials are not properly configured and/or propogated #7
Comments
I'm guessing that your secret is just the github token. It should instead be git credentials in the format specified by You can change the credentials settings to this (you'll have to fill-in the - uses: fusion-engineering/setup-git-credentials@v2
with:
credentials: https://$username:${{ secrets.SNMIX_REPO_ACCESS_TOKEN }}@github.com/
- run: cat ~/.gitconfig Alternatively, you can put that directly in a secret, which also allows you to add credentials for different URLs. Does this solve your issue? :) |
Thanks for the response. I did not understand your "alternate" suggestion. Can you give an example? I tried your suggestion: ($username replaced with correct one) - uses: fusion-engineering/setup-git-credentials@v2
with:
credentials: https://$username:${{ secrets.SNMIX_REPO_ACCESS_TOKEN }}@github.com/
- run: cat ~/.gitconfig output: Run fusion-engineering/setup-git-credentials@v2
with:
credentials: ***github.com/
env:
GOROOT: /opt/hostedtoolcache/go/1.15.5/x64
git config --global credential.helper store
git config --global url.https://github.com/.insteadOf ssh://[email protected]/
git config --global --add url.https://github.com/.insteadOf [email protected]:
Run cat ~/.gitconfig
[credential]
helper = store
[url "https://github.com/"]
insteadOf = ssh://[email protected]/
insteadOf = [email protected]:
....
Setting up auth
/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
Determining the default branch
Retrieving the default branch name
Not Found |
Where does this come from? It doesn't look like anything that |
Hello, I have - uses: fusion-engineering/setup-git-credentials@v2
with:
credentials: https://$username:${{ secrets.MY_PAT }}@github.com/
- run: cat ~/.gitconfig
- name: Check out code into the Go module directory
uses: actions/checkout@v2
env:
GOPRIVATE: "github.com/myorg/*"
with:
fetch-depth: 1
path: src/github.com/myorg/repo-a
submodules: true
- name: Checkout myorg/repo-b
uses: actions/checkout@v2
with:
repository: switchnomix/repo-b
path: src/github.com/myorg/repo-b The first checkout of |
I might've had a similar problem I tried cloning a local repository. In CI repository was not found, but locally everything worked. By default Github Actions (and Azure CI) adds an extra header to clone the repository Git config file examples from ci workflows after running
Running CI workflow example: steps:
- name: Checkout
uses: actions/checkout@v4
- name: remove default credentials
run: git config --local --unset http.https://github.com/.extraheader
- uses: de-vri-es/setup-git-credentials@v2
with:
credentials: ${{secrets.GIT_CREDENTIALS}} |
Hmm, that seems odd. The What command/tool is cloning the extra repositories? |
I was trying to install a node module from a private git repository. The ci looked like thisjobs:
checks:
name: Checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: de-vri-es/setup-git-credentials@v2
with:
credentials: ${{secrets.GIT_CREDENTIALS}}
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci --no-audit I think Then git --no-replace-objects ls-remote ssh://[email protected]/octocat/private.git I think git used both |
Ah.. yeah.. It's kinda the fault of the They should really set it only for But I'm also hesitant to add a work-around for it here. At best, it would only work if you run this action after the checkout action. But we could add your workaround to the |
Perhaps, adding the workaround to the README is the best option. Then people will be aware that the |
I have an Organization setting for my repos. I am building go binary for one with another private module in a different repo. The token supplied has organization setting.
With the below action the repo itself is not found. Am I missing any settings?
Output when running the action:
The text was updated successfully, but these errors were encountered: