Skip to content

Commit

Permalink
Restore git global config
Browse files Browse the repository at this point in the history
`setup-git-redirect.sh` is needed for tests, because go needs SSH
authentication, when downloading modules dependencies. The redirect
script, though, does not revert the global changes done to the git
config (in that case: SSH instead of HTTPS). The `checkout` action,
on the other hand, needs the HTTPS for checkout, because the SSH key at the
beginning of the action is no longer available, it was properly cleaned
up in the `webfactory/ssh-agent` post clean up.

Implementing workaround as in webfactory/ssh-agent#184
  • Loading branch information
damyan authored and guvenc committed Oct 5, 2023
1 parent c35cbe1 commit b5a2889
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,8 @@ jobs:
ssh-private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- run: ./hack/setup-git-redirect.sh
- run: make test
- name: Restore git global config
if: always()
run: |
MATCH=$(grep -o 'git@.*github\.com:' ~/.gitconfig)
git config --global --remove-section url.${MATCH}

0 comments on commit b5a2889

Please sign in to comment.