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

CI: reset existing repo to known state #11880

Merged
merged 1 commit into from Mar 24, 2021

Conversation

smarter
Copy link
Member

@smarter smarter commented Mar 24, 2021

If at some point a PR accidentally deletes a git submodule without
deleting it from .gitmodules, subsequent PRs using the same runner will
fail because the checkout action will try to run git submodule foreach ... before updating the git repo to match the current PR and fail, we
can avoid the problem by always resetting to origin/master which
hopefully is always in a good state.

Ideally the checkout action would be more robust: actions/checkout#354

@smarter
Copy link
Member Author

smarter commented Mar 24, 2021

The slightly weird -c "http.https://github.com/.extraheader=" is needed to avoid authentication issues related to whatever the checkout actions does.

If at some point a PR accidentally deletes a git submodule without
deleting it from .gitmodules, subsequent PRs using the same runner will
fail because the checkout action will try to run `git submodule foreach
...` before updating the git repo to match the current PR and fail, we
can avoid the problem by always resetting to origin/master which
hopefully is always in a good state.

The `-c "http.https://github.com/.extraheader="` resets a setting set by
the checkout action which causes authentication issues when fetching.

Ideally the checkout action would be more robust: actions/checkout#354
@smarter smarter enabled auto-merge March 24, 2021 15:43
@smarter smarter merged commit a3d1a67 into scala:master Mar 24, 2021
@smarter smarter deleted the fix-submodules-3 branch March 24, 2021 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants