Showing with 35,208 additions and 38,325 deletions.
  1. +3 −3 .github/workflows/check-dist.yml
  2. +3 −3 .github/workflows/codeql-analysis.yml
  3. +1 −1 .github/workflows/licensed.yml
  4. +71 −6 .github/workflows/test.yml
  5. +31 −0 .github/workflows/update-main-version.yml
  6. +2 −1 .gitignore
  7. +3 −3 .licenses/npm/@actions/core.dep.yml
  8. +10 −20 .licenses/npm/@actions/github.dep.yml
  9. +2 −2 .licenses/npm/@actions/http-client.dep.yml
  10. +4 −2 .licenses/npm/@actions/io.dep.yml
  11. +2 −2 .licenses/npm/@octokit/auth-token.dep.yml
  12. +4 −4 .licenses/npm/@octokit/{request-error-2.0.0.dep.yml → core.dep.yml}
  13. +2 −2 .licenses/npm/@octokit/endpoint.dep.yml
  14. +2 −2 .licenses/npm/@octokit/graphql.dep.yml
  15. +9 −10 .licenses/npm/{windows-release.dep.yml → @octokit/openapi-types.dep.yml}
  16. +2 −2 .licenses/npm/@octokit/plugin-paginate-rest.dep.yml
  17. +0 −20 .licenses/npm/@octokit/plugin-request-log.dep.yml
  18. +2 −2 .licenses/npm/@octokit/plugin-rest-endpoint-methods.dep.yml
  19. +2 −2 .licenses/npm/@octokit/{request-error-1.2.1.dep.yml → request-error.dep.yml}
  20. +3 −3 .licenses/npm/@octokit/request.dep.yml
  21. +0 −35 .licenses/npm/@octokit/rest.dep.yml
  22. +2 −2 .licenses/npm/@octokit/types.dep.yml
  23. +0 −26 .licenses/npm/@types/node.dep.yml
  24. +0 −32 .licenses/npm/atob-lite.dep.yml
  25. +2 −2 .licenses/npm/before-after-hook.dep.yml
  26. +0 −32 .licenses/npm/btoa-lite.dep.yml
  27. +0 −34 .licenses/npm/cross-spawn.dep.yml
  28. +0 −34 .licenses/npm/end-of-stream.dep.yml
  29. +0 −22 .licenses/npm/get-stream.dep.yml
  30. +2 −2 .licenses/npm/is-plain-object.dep.yml
  31. +0 −34 .licenses/npm/is-stream.dep.yml
  32. +0 −26 .licenses/npm/isexe.dep.yml
  33. +0 −40 .licenses/npm/isobject.dep.yml
  34. +0 −58 .licenses/npm/lodash.get.dep.yml
  35. +0 −58 .licenses/npm/lodash.set.dep.yml
  36. +0 −58 .licenses/npm/lodash.uniq.dep.yml
  37. +0 −22 .licenses/npm/macos-release.dep.yml
  38. +0 −32 .licenses/npm/nice-try.dep.yml
  39. +1 −1 .licenses/npm/node-fetch.dep.yml
  40. +0 −34 .licenses/npm/npm-run-path.dep.yml
  41. +0 −35 .licenses/npm/octokit-pagination-methods.dep.yml
  42. +0 −22 .licenses/npm/os-name.dep.yml
  43. +0 −35 .licenses/npm/p-finally.dep.yml
  44. +0 −34 .licenses/npm/path-key.dep.yml
  45. +0 −34 .licenses/npm/pump.dep.yml
  46. +1 −1 .licenses/npm/qs.dep.yml
  47. +0 −26 .licenses/npm/semver-5.7.1.dep.yml
  48. +1 −1 .licenses/npm/{semver-6.3.0.dep.yml → semver.dep.yml}
  49. +0 −34 .licenses/npm/shebang-command.dep.yml
  50. +0 −34 .licenses/npm/shebang-regex.dep.yml
  51. +0 −27 .licenses/npm/signal-exit.dep.yml
  52. +0 −34 .licenses/npm/strip-eof.dep.yml
  53. +0 −20 .licenses/npm/universal-user-agent-5.0.0.dep.yml
  54. +3 −3 .licenses/npm/{universal-user-agent-4.0.1.dep.yml → universal-user-agent.dep.yml}
  55. 0 .licenses/npm/{uuid.dep.yml → uuid-3.3.3.dep.yml}
  56. +7 −9 .licenses/npm/{execa.dep.yml → uuid-8.3.2.dep.yml}
  57. +0 −27 .licenses/npm/which.dep.yml
  58. +51 −1 CHANGELOG.md
  59. +28 −0 CONTRIBUTING.md
  60. +74 −32 README.md
  61. +53 −10 __test__/git-auth-helper.test.ts
  62. +266 −0 __test__/git-command-manager.test.ts
  63. +64 −0 __test__/git-directory-helper.test.ts
  64. +4 −0 __test__/input-helper.test.ts
  65. +51 −0 __test__/verify-sparse-checkout-non-cone-mode.sh
  66. +63 −0 __test__/verify-sparse-checkout.sh
  67. +19 −1 action.yml
  68. +2 −2 adrs/0153-checkout-v2.md
  69. +15,004 −32,908 dist/index.js
  70. +18,871 −4,104 package-lock.json
  71. +9 −8 package.json
  72. +31 −16 src/git-auth-helper.ts
  73. +137 −30 src/git-command-manager.ts
  74. +7 −1 src/git-directory-helper.ts
  75. +160 −92 src/git-source-provider.ts
  76. +25 −0 src/git-source-settings.ts
  77. +22 −20 src/github-api-helper.ts
  78. +24 −0 src/input-helper.ts
  79. +1 −1 src/misc/generate-docs.ts
  80. +1 −1 src/misc/licensed-check.sh
  81. +7 −7 src/misc/licensed-download.sh
  82. +1 −1 src/misc/licensed-generate.sh
  83. +10 −12 src/ref-helper.ts
  84. +21 −19 src/state-helper.ts
  85. +25 −9 src/url-helper.ts
6 changes: 3 additions & 3 deletions .github/workflows/check-dist.yml
Expand Up @@ -22,12 +22,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set Node.js 12.x
- name: Set Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 16.x

- name: Install dependencies
run: npm ci
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Expand Up @@ -39,10 +39,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -55,4 +55,4 @@ jobs:
- run: rm -rf dist # We want code scanning to analyze lib instead (individual .js files)

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
2 changes: 1 addition & 1 deletion .github/workflows/licensed.yml
Expand Up @@ -9,6 +9,6 @@ jobs:
runs-on: ubuntu-latest
name: Check licenses
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: npm ci
- run: npm run licensed-check
77 changes: 71 additions & 6 deletions .github/workflows/test.yml
Expand Up @@ -13,8 +13,8 @@ jobs:
steps:
- uses: actions/setup-node@v1
with:
node-version: 12.x
- uses: actions/checkout@v2
node-version: 16.x
- uses: actions/checkout@v3
- run: npm ci
- run: npm run build
- run: npm run format-check
Expand All @@ -32,7 +32,7 @@ jobs:
steps:
# Clone this repo
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

# Basic checkout
- name: Checkout basic
Expand Down Expand Up @@ -72,6 +72,33 @@ jobs:
shell: bash
run: __test__/verify-side-by-side.sh

# Sparse checkout
- name: Sparse checkout
uses: ./
with:
sparse-checkout: |
__test__
.github
dist
path: sparse-checkout

- name: Verify sparse checkout
run: __test__/verify-sparse-checkout.sh

# Sparse checkout (non-cone mode)
- name: Sparse checkout (non-cone mode)
uses: ./
with:
sparse-checkout: |
/__test__/
/.github/
/dist/
sparse-checkout-cone-mode: false
path: sparse-checkout-non-cone-mode

- name: Verify sparse checkout (non-cone mode)
run: __test__/verify-sparse-checkout-non-cone-mode.sh

# LFS
- name: Checkout LFS
uses: ./
Expand Down Expand Up @@ -142,15 +169,15 @@ jobs:
options: --dns 127.0.0.1
services:
squid-proxy:
image: datadog/squid:latest
image: ubuntu/squid:latest
ports:
- 3128:3128
env:
https_proxy: http://squid-proxy:3128
steps:
# Clone this repo
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

# Basic checkout using git
- name: Checkout basic
Expand Down Expand Up @@ -182,7 +209,7 @@ jobs:
steps:
# Clone this repo
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

# Basic checkout using git
- name: Checkout basic
Expand All @@ -205,3 +232,41 @@ jobs:
path: basic
- name: Verify basic
run: __test__/verify-basic.sh --archive

test-git-container:
runs-on: ubuntu-latest
container: bitnami/git:latest
steps:
# Clone this repo
- name: Checkout
uses: actions/checkout@v3
with:
path: v3

# Basic checkout using git
- name: Checkout basic
uses: ./v3
with:
ref: test-data/v2/basic
- name: Verify basic
run: |
if [ ! -f "./basic-file.txt" ]; then
echo "Expected basic file does not exist"
exit 1
fi
# Verify .git folder
if [ ! -d "./.git" ]; then
echo "Expected ./.git folder to exist"
exit 1
fi
# Verify auth token
git config --global --add safe.directory "*"
git fetch --no-tags --depth=1 origin +refs/heads/main:refs/remotes/origin/main
# needed to make checkout post cleanup succeed
- name: Fix Checkout v3
uses: actions/checkout@v3
with:
path: v3
31 changes: 31 additions & 0 deletions .github/workflows/update-main-version.yml
@@ -0,0 +1,31 @@
name: Update Main Version
run-name: Move ${{ github.event.inputs.major_version }} to ${{ github.event.inputs.target }}

on:
workflow_dispatch:
inputs:
target:
description: The tag or reference to use
required: true
major_version:
type: choice
description: The major version to update
options:
- v3
- v2

jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Git config
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Tag new target
run: git tag -f ${{ github.event.inputs.major_version }} ${{ github.event.inputs.target }}
- name: Push new tag
run: git push origin ${{ github.event.inputs.major_version }} --force
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,4 +1,5 @@
__test__/_temp
_temp/
lib/
node_modules/
node_modules/
.vscode/
6 changes: 3 additions & 3 deletions .licenses/npm/@actions/core.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 10 additions & 20 deletions .licenses/npm/@actions/github.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .licenses/npm/@actions/http-client.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions .licenses/npm/@actions/io.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .licenses/npm/@octokit/auth-token.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .licenses/npm/@octokit/endpoint.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .licenses/npm/@octokit/graphql.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .licenses/npm/@octokit/plugin-paginate-rest.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.