0
1
Fork 0
mirror of https://github.com/actions/checkout synced 2024-06-25 15:48:19 +02:00
checkout/src
Jeff Widman aea6c75c98
Suppress "detached head" advice during checkout
Checking out certain `ref` values will result in a warning about a detached `HEAD`:
```
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false
```

However, this warning isn't useful in a CI environment... so suppress it.

I realize on the original bug report that one user mentioned this warning
highlighted a bug in his actions flow, but I consider that a super rare / happy accident.
99% of use cases will be _intentionally_ checking out a specific ref where
the detached head state is inevitable, so the warning is pure noise.

Passing the config this way sets it _only_ for this command. Note that it
must be set [_before_ calling `checkout`](https://stackoverflow.com/a/72588008/770425).

Resolve: https://github.com/actions/checkout/issues/494
2022-10-23 21:29:17 -07:00
..
misc Patch to fix the dependbot alert. (#744) 2022-04-05 13:01:33 -04:00
fs-helper.ts update dev dependencies and react to new linting rules (#611) 2021-10-19 09:52:57 -05:00
git-auth-helper.ts Inject GitHub host to be able to clone from another GitHub instance (#922) 2022-09-26 12:34:52 -04:00
git-command-manager.ts Suppress "detached head" advice during checkout 2022-10-23 21:29:17 -07:00
git-directory-helper.ts update dev dependencies and react to new linting rules (#611) 2021-10-19 09:52:57 -05:00
git-source-provider.ts Inject GitHub host to be able to clone from another GitHub instance (#922) 2022-09-26 12:34:52 -04:00
git-source-settings.ts Inject GitHub host to be able to clone from another GitHub instance (#922) 2022-09-26 12:34:52 -04:00
git-version.ts Convert checkout to a regular action (#70) 2019-12-03 10:28:59 -05:00
github-api-helper.ts Inject GitHub host to be able to clone from another GitHub instance (#922) 2022-09-26 12:34:52 -04:00
input-helper.ts Inject GitHub host to be able to clone from another GitHub instance (#922) 2022-09-26 12:34:52 -04:00
main.ts set insteadOf url for org-id (#621) 2021-11-01 11:43:18 -05:00
octokit-provider.ts Inject GitHub host to be able to clone from another GitHub instance (#922) 2022-09-26 12:34:52 -04:00
ref-helper.ts Inject GitHub host to be able to clone from another GitHub instance (#922) 2022-09-26 12:34:52 -04:00
regexp-helper.ts add support for submodules (#173) 2020-03-05 14:21:59 -05:00
retry-helper.ts update dev dependencies and react to new linting rules (#611) 2021-10-19 09:52:57 -05:00
state-helper.ts Bump @actions/core to 1.10.0 (#939) 2022-10-03 18:04:49 +01:00
url-helper.ts Inject GitHub host to be able to clone from another GitHub instance (#922) 2022-09-26 12:34:52 -04:00
workflow-context-helper.ts set insteadOf url for org-id (#621) 2021-11-01 11:43:18 -05:00