Skip to content
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

fix: GitHub - Support Token File for Git Commands #5067

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

meringu
Copy link
Contributor

@meringu meringu commented Nov 5, 2024

what

Quick follow up to #3208.

I noticed during testing that we need to also set the token file here. I believe I must have been testing by running against a PR with a commit that was already checked out on the persistent volume. Atlantis detected that it didn't need to perform a git clone command.

I've updated my testing to include testing with a new PR and new commit, forcing a clean checkout.

why

The GitHub client credentials are separate to the git client credentials, so we must set the token file here too when configuring Atlantis for a token file rather than the token directly.

tests

Tested this with a clean clone in my environment.

references

#3208

Signed-off-by: Henry Muru Paenga <meringu@gmail.com>
@meringu meringu requested review from a team as code owners November 5, 2024 10:40
@meringu meringu requested review from chenrui333, lukemassa and X-Guardian and removed request for a team November 5, 2024 10:40
@github-actions github-actions bot added the go Pull requests that update Go code label Nov 5, 2024
@X-Guardian X-Guardian changed the title fix: use github token file for git commands fix: GitHub - Support Token File for Git Commands Nov 5, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 5, 2024
@X-Guardian X-Guardian merged commit 240b6b1 into runatlantis:main Nov 5, 2024
35 checks passed
@X-Guardian
Copy link
Contributor

Thanks for this @meringu. Can you test with one of the following container images: dev-debian-240b6b1 or dev-alpine-240b6b1

@meringu
Copy link
Contributor Author

meringu commented Nov 8, 2024

Sorry for the delay @X-Guardian. I had mounted my secret with a K8s subPath, which meant the token wasn't rotating on the container volume during my tests.

I've corrected that, and can now run plans over an hour long, proving that the token is being rotated, as my tokens only last one hour.

This looks ready to go from my point of view. Thanks!

@meringu meringu deleted the token-file-git-client branch November 8, 2024 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code lgtm This PR has been approved by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants