-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add set-safe-directory input to allow customer to take control. #770
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This fix should allow setting safe.directory manually and not having it overridden by the actions/checkout action. Test the behaviour works as expected for both the Cygwin runner (with a manually set safe.directory in the Git config file) and the Ubuntu runner (with no explicit safe.directory wrangling). Disable build steps that are unnecessary / slow / would produce permanent changes. Enable steps that we want to check with this action even though they'd normally only be run for actual releases (subject to the previous caveat).
I've just kicked off a build at https://github.com/me-and/Cygwin-Git/actions/runs/2194248694, where I was hitting #767; the fix looks good, but the test should properly confirm that the fix resolves the problem I was seeing. |
No, this doesn't work, at least as a fix for #767:
It looks like it's still copying the I don't think this change is a bad change, it just doesn't resolve my problem. I think resolving #767 needs to either entirely stop actions/checkout creating a temporary "global" |
|
||
test-git-container: | ||
runs-on: ubuntu-latest | ||
container: bitnami/git:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will have e2e coverage on any newer git version release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
มันน่าจะดีมากขึ้นไปอีก ผมเคารพการตัดสินใจของชุมชน
2839779
to
49508e7
Compare
git config --global --add safe.directory "*" | ||
git fetch --no-tags --depth=1 origin +refs/heads/main:refs/remotes/origin/main | ||
|
||
- name: Fix Checkout v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we running this again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the second checkout will wipe the initial checkout and cause post-cleanup to fail...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe i can do clean:false
, let me try...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't work... 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets add a quick comment if we can just to say # needed to make post run succeed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
จัดการได้ตามความเหมาะสม เห็นชอบ ของชุมชน
718cc50
to
49508e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@me-and I updated the branch to make sure when |
Yes, that seems to work! The full run hasn't completed yet, but it has got through the checkout stage using Cygwin Git. Thank you! |
* Add set-safe-directory input to allow customers to take control.
… (#776) * Add set-safe-directory input to allow customers to take control.
This has been resolved in the [checkout](actions/checkout#770) action and would already be set by default.
Bumps actions/checkout from 3 to 3.0.2. Release notes Sourced from actions/checkout's releases. v3.0.2 What's Changed Add set-safe-directory input to allow customers to take control. by @TingluoHuang in actions/checkout#770 Prepare changelog for v3.0.2. by @TingluoHuang in actions/checkout#777 Full Changelog: actions/checkout@v3...v3.0.2 v3.0.1 Fixed an issue where checkout failed to run in container jobs due to the new git setting safe.directory Bumped various npm package versions Changelog Sourced from actions/checkout's changelog. Changelog v3.0.2 Add input set-safe-directory v3.0.1 Fixed an issue where checkout failed to run in container jobs due to the new git setting safe.directory Bumped various npm package versions v3.0.0 Update to node 16 v2.3.1 Fix default branch resolution for .wiki and when using SSH v2.3.0 Fallback to the default branch v2.2.0 Fetch all history for all tags and branches when fetch-depth=0 v2.1.1 Changes to support GHES (here and here) v2.1.0 Group output Changes to support GHES alpha release Persist core.sshCommand for submodules Add support ssh Convert submodule SSH URL to HTTPS, when not using SSH Add submodule support Follow proxy settings Fix ref for pr closed event when a pr is merged Fix issue checking detached when git less than 2.22 v2.0.0 Do not pass cred on command line Add input persist-credentials Fallback to REST API to download repo v2 (beta) Improved fetch performance ... (truncated) Commits See full diff in compare view Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase. Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: @dependabot rebase will rebase this PR @dependabot recreate will recreate this PR, overwriting any edits that have been made to it @dependabot merge will merge this PR after your CI passes on it @dependabot squash and merge will squash and merge this PR after your CI passes on it @dependabot cancel merge will cancel a previously requested merge and block automerging @dependabot reopen will reopen this PR if it is closed @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This has been resolved in the [checkout](actions/checkout#770) action and would already be set by default. Update README.md Fix removed code lines * Add force with lease support * Update the documentation fix: github_token and github_url optional Add atomic push Since time elapses between the checkout the github workflow performs and the eventual push this action invokes the remote HEAD may have changed. If this is the case the HEAD update will be rejected but any tag (and their commits) will be pushed. In general I think this operation should be atomic, either we push everything or we push nothing. Force pushes still work the way you would expect (i.e. if we force the HEAD update with --atomic everything is still pushed) This also protects from the situation where someone else has seized your tag name in the meantime but not updated your HEAD. See git docs for more information - https://git-scm.com/docs/git-push#Documentation/git-push.txt---no-atomic Add option to control atomic switch Use node16 to run action Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Update the documentation and the push process feat: Restructure the code Update the documentation and the push process
2 |
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/releases">actions/checkout's releases</a>.</em></p> <blockquote> <h2>v4.0.0</h2> <h2>What's Changed</h2> <ul> <li>Update default runtime to node20 by <a href="https://github.com/takost"><code>@takost</code></a> in <a href="h ttps://github.com/actions/checkout/pull/1436">actions/checkout# 1436</a></li> <li>Support fetching without the --progress option by <a href="https://github.com/simonbaird"><code>@simonbaird</code></a> in <a href="https://github.com/actions/checkout/pull/1067">actions/ch eckout#1067</a></li> <li>Release 4.0.0 by <a href="https://github.com/takost"><code>@takost</code></a> in <a href="h ttps://github.com/actions/checkout/pull/1447">actions/checkout# 1447</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/takost"><code>@takost</code></a> made their first contribution in <a href="https://github.com/actions /checkout/pull/1436">actions/checkout#1436</a></li> <li><a href="https://github.com/simonbaird"><code>@simonbaird</code></a> made their first contribution in <a href="https://github.com/actions /checkout/pull/1067">actions/checkout#1067</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/ checkout/compare/v3...v4.0.0">https://github.com/actions/checkout/compar e/v3...v4.0.0</a></p> <h2>v3.6.0</h2> <h2>What's Changed</h2> <ul> <li>Mark test scripts with Bash'isms to be run via Bash by <a href="https://github.com/dscho"><code>@dscho</code></a> in <a href="htt ps://github.com/actions/checkout/pull/1377">actions/checkout#13 77</a></li> <li>Add option to fetch tags even if fetch-depth > 0 by <a href="http s://github.com/RobertWieczoreck"><code>@RobertWieczoreck</code></a> in <a href="https://github.com/actions/checkout/pull/579">actions/ checkout#579</a></li> <li>Release 3.6.0 by <a href="https://github.com/luketomlinson"><code>@luketomlinson</code></a> in <a href="https://github.com/actions/checkout/pull/1437">acti ons/checkout#1437</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/RobertWieczoreck"><code>@RobertWieczore ck</code></a> made their first contribution in <a href="https://redirect .git.luolix.top/actions/checkout/pull/579">actions/checkout#579</a></li> <li><a href="https://github.com/luketomlinson"><code>@luketomlinson</code></a> made their first contribution in <a href="https://github.com/ac tions/checkout/pull/1437">actions/checkout#1437</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/ checkout/compare/v3.5.3...v3.6.0">https://github.com/actions/checkout/co mpare/v3.5.3...v3.6.0</a></p> <h2>v3.5.3</h2> <h2>What's Changed</h2> <ul> <li>Fix: Checkout Issue in self hosted runner due to faulty submodule check-ins by <a href="https://github.com/megamanics"><code>@megamanics</code></a> in <a href="https://github.com/actions/checkout/pull/1196">actions/ch eckout#1196</a></li> <li>Fix typos found by codespell by <a href="https://github.com/DimitriP apadopoulos"><code>@DimitriPapadopoulos</code></a> in <a href="https:// github.com/actions/checkout/pull/1287">actions/checkout#1287</a ></li> <li>Add support for sparse checkouts by <a href="https://github.com/dscho"><code>@dscho</code></a> and <a href="https://github.com/dfdez"><code>@dfdez</code></a> in <a href="htt ps://github.com/actions/checkout/pull/1369">actions/checkout#13 69</a></li> <li>Release v3.5.3 by <a href="https://github.com/TingluoHuang"><code>@TingluoHuang</code></a> in <a href="https://github.com/actions/checkout/pull/1376">acti ons/checkout#1376</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/megamanics"><code>@megamanics</code></a> made their first contribution in <a href="https://github.com/actions /checkout/pull/1196">actions/checkout#1196</a></li> <li><a href="https://github.com/DimitriPapadopoulos"><code>@DimitriPapa dopoulos</code></a> made their first contribution in <a href="https://re direct.github.com/actions/checkout/pull/1287">actions/checkout#1287</a>< /li> <li><a href="https://github.com/dfdez"><code>@dfdez</code></a> made their first contribution in <a href="https://github.com/actions /checkout/pull/1369">actions/checkout#1369</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/ checkout/compare/v3...v3.5.3">https://github.com/actions/checkout/compar e/v3...v3.5.3</a></p> <h2>v3.5.2</h2> <h2>What's Changed</h2> <ul> <li>Fix: Use correct API url / endpoint in GHES by <a href="https://github.com/fhammerl"><code>@fhammerl</code></a> in <a hre f="https://github.com/actions/checkout/pull/1289">actions/check out#1289</a> based on <a href="https://github.com/actions/check out/issues/1286">sagemath#1286</a> by <a href="https://github.com/1newsr"><code>@1newsr</code></a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/ checkout/compare/v3.5.1...v3.5.2">https://github.com/actions/checkout/co mpare/v3.5.1...v3.5.2</a></p> <h2>v3.5.1</h2> <h2>What's Changed</h2> <ul> <li>Improve checkout performance on Windows runners by upgrading <code>@actions/github</code> dependency by <a href="https://github.com/BrettDong"><code>@BrettDong</code></a> in <a h ref="https://github.com/actions/checkout/pull/1246">actions/che ckout#1246</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/BrettDong"><code>@BrettDong</code></a> made their first contribution in <a href="https://github.com/ac tions/checkout/pull/1246">actions/checkout#1246</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/blob/ma in/CHANGELOG.md">actions/checkout's changelog</a>.</em></p> <blockquote> <h1>Changelog</h1> <h2>v4.0.0</h2> <ul> <li><a href="https://github.com/actions/checkout/pull/1067">Support fetching without the --progress option</a></li> <li><a href="https://github.com/actions/checkout/pull/1436">Update to node20</a></li> </ul> <h2>v3.6.0</h2> <ul> <li><a href="https://github.com/actions/checkout/pull/1377">Fix: Mark test scripts with Bash'isms to be run via Bash</a></li> <li><a href="https://github.com/actions/checkout/pull/579">Add option to fetch tags even if fetch-depth > 0</a></li> </ul> <h2>v3.5.3</h2> <ul> <li><a href="https://github.com/actions/checkout/pull/1196">Fix: Checkout fail in self-hosted runners when faulty submodule are checked- in</a></li> <li><a href="https://github.com/actions/checkout/pull/1287">Fix typos found by codespell</a></li> <li><a href="https://github.com/actions/checkout/pull/1369">Add support for sparse checkouts</a></li> </ul> <h2>v3.5.2</h2> <ul> <li><a href="https://github.com/actions/checkout/pull/1289">Fix api endpoint for GHES</a></li> </ul> <h2>v3.5.1</h2> <ul> <li><a href="https://github.com/actions/checkout/pull/1246">Fix slow checkout on Windows</a></li> </ul> <h2>v3.5.0</h2> <ul> <li><a href="https://github.com/actions/checkout/pull/1237">Add new public key for known_hosts</a></li> </ul> <h2>v3.4.0</h2> <ul> <li><a href="https://github.com/actions/checkout/pull/1209">Upgrade codeql actions to v2</a></li> <li><a href="https://github.com/actions/checkout/pull/1210">Upgrade dependencies</a></li> <li><a href="https://github.com/actions/checkout/pull/1225">Upgrade <code>@actions/io</code></a></li> </ul> <h2>v3.3.0</h2> <ul> <li><a href="https://github.com/actions/checkout/pull/1045">Implement branch list using callbacks from exec function</a></li> <li><a href="https://github.com/actions/checkout/pull/1050">Add in explicit reference to private checkout options</a></li> <li>[Fix comment typos (that got added in <a href="https://redirect.gith ub.com/actions/checkout/issues/770">sagemath#770</a>)](<a href="https://redirect .git.luolix.top/actions/checkout/pull/1057">actions/checkout#1057</a>)</li> </ul> <h2>v3.2.0</h2> <ul> <li><a href="https://github.com/actions/checkout/pull/942">Add GitHub Action to perform release</a></li> <li><a href="https://github.com/actions/checkout/pull/967">Fix status badge</a></li> <li><a href="https://github.com/actions/checkout/pull/1002">Replace datadog/squid with ubuntu/squid Docker image</a></li> <li><a href="https://github.com/actions/checkout/pull/964">Wrap pipeline commands for submoduleForeach in quotes</a></li> <li><a href="https://github.com/actions/checkout/pull/1029">Update <code>@actions/io</code> to 1.1.2</a></li> <li><a href="https://github.com/actions/checkout/pull/1039">Upgrading version to 3.2.0</a></li> </ul> <h2>v3.1.0</h2> <ul> <li><a href="https://github.com/actions/checkout/pull/939">Use <code>@actions/core</code> <code>saveState</code> and <code>getState</code></a></li> <li><a href="https://github.com/actions/checkout/pull/922">Add <code>github-server-url</code> input</a></li> </ul> <h2>v3.0.2</h2> <ul> <li><a href="https://github.com/actions/checkout/pull/770">Add input <code>set-safe-directory</code></a></li> </ul> <h2>v3.0.1</h2> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="actions/checkout@3df4ab11eba7bda6 032a0b82a6bb43b11571feac"><code>3df4ab1</code></a> Release 4.0.0 (<a hre f="https://github.com/actions/checkout/issues/1447">#1447</a>)< /li> <li><a href="actions/checkout@8b5e8b768746b503 94015010d25e690bfab9dfbc"><code>8b5e8b7</code></a> Support fetching without the --progress option (<a href="https://github.com/acti ons/checkout/issues/1067">sagemath#1067</a>)</li> <li><a href="actions/checkout@97a652b80035363d f47baee5031ec8670b8878ac"><code>97a652b</code></a> Update default runtime to node20 (<a href="https://github.com/actions/checkout sagemath/issues/1436">sagemath#1436</a>)</li> <li>See full diff in <a href="https://github.com/actions/checkout/compare/v3...v4">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot- badges.githubapp.com/badges/compatibility_score?dependency- name=actions/checkout&package-manager=github_actions&previous- version=3&new-version=4)](https://docs.github.com/en/github/managing- security-vulnerabilities/about-dependabot-security-updates#about- compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> URL: sagemath#36243 Reported by: dependabot[bot] Reviewer(s):
In case of customers don't like the way we overwrite their global
gitconfig
withsafe.directory
.Ex: customers have properly configured
safe.directory
on their environment, andactions/checkout
overlay the wrong value.