0
1
Fork 0
mirror of https://github.com/actions/checkout synced 2024-06-26 15:58:20 +02:00
checkout/src
brian m. carlson 02ade5d400
Don't overwrite annotated tags with commit object
When checking out a repository with full history, a full clone is done
and then the ref is finally updated to point to the commit that caused
the workflow to be run.  Normally, this is a good protection against
someone pushing to the repository twice in short succession, but it
causes problems with annotated tags.

Specifically, because the entry in refs/tags is set to the commit hash,
if an annotated tag was used, the tag is turned merely into a
lightweight one, which breaks `git describe`.  Every other tag in the
repository will continue to remain a valid annotated tag except the one
for which the workflow was invoked, which is not what the user expected.

Let's work around this by not performing a fetch if what we're fetching
is a tag.  Technically, annotated tags can be anywhere in the hierarchy
at any ref, but this should work as a suitable heuristic for now.

Note that the proper solution would be to expose the revision of the
actual object and check against that instead of the commit, but it
doesn't presently appear that that information is exposed.  Also, we
explicitly do not case-fold since Git refs are case sensitive.
2022-02-14 23:18:53 +00:00
..
misc script to generate license info (#614) 2021-10-19 14:30:04 -05: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 set insteadOf url for org-id (#621) 2021-11-01 11:43:18 -05:00
git-command-manager.ts set insteadOf url for org-id (#621) 2021-11-01 11:43:18 -05: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 Don't overwrite annotated tags with commit object 2022-02-14 23:18:53 +00:00
git-source-settings.ts set insteadOf url for org-id (#621) 2021-11-01 11:43:18 -05:00
git-version.ts Convert checkout to a regular action (#70) 2019-12-03 10:28:59 -05:00
github-api-helper.ts update dev dependencies and react to new linting rules (#611) 2021-10-19 09:52:57 -05:00
input-helper.ts set insteadOf url for org-id (#621) 2021-11-01 11:43:18 -05:00
main.ts set insteadOf url for org-id (#621) 2021-11-01 11:43:18 -05:00
ref-helper.ts update dev dependencies and react to new linting rules (#611) 2021-10-19 09:52:57 -05: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 add ssh support (#163) 2020-03-11 15:55:17 -04:00
url-helper.ts switch GITHUB_URL to GITHUB_SERVER_URL (#248) 2020-05-18 13:05:15 -04:00
workflow-context-helper.ts set insteadOf url for org-id (#621) 2021-11-01 11:43:18 -05:00