mirror of
				https://github.com/actions/checkout.git
				synced 2025-10-31 22:08:09 +08:00 
			
		
		
		
	Compare commits
	
		
			9 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 2541b1294d | ||
|  | 0ffe6f9c55 | ||
|  | dcd71f6466 | ||
|  | add3486cc3 | ||
|  | 5126516654 | ||
|  | d50f8ea767 | ||
|  | 2d1c1198e7 | ||
|  | a12a3943b4 | ||
|  | 8f9e05e482 | 
							
								
								
									
										6
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
								
							| @@ -22,12 +22,12 @@ jobs: | |||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|  |  | ||||||
|     steps: |     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 |         uses: actions/setup-node@v1 | ||||||
|         with: |         with: | ||||||
|           node-version: 12.x |           node-version: 16.x | ||||||
|  |  | ||||||
|       - name: Install dependencies |       - name: Install dependencies | ||||||
|         run: npm ci |         run: npm ci | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								.github/workflows/codeql-analysis.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/codeql-analysis.yml
									
									
									
									
										vendored
									
									
								
							| @@ -39,7 +39,7 @@ jobs: | |||||||
|  |  | ||||||
|     steps: |     steps: | ||||||
|     - name: Checkout repository |     - name: Checkout repository | ||||||
|       uses: actions/checkout@v2 |       uses: actions/checkout@v3 | ||||||
|  |  | ||||||
|     - name: Initialize CodeQL |     - name: Initialize CodeQL | ||||||
|       uses: github/codeql-action/init@v1 |       uses: github/codeql-action/init@v1 | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								.github/workflows/licensed.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/licensed.yml
									
									
									
									
										vendored
									
									
								
							| @@ -9,6 +9,6 @@ jobs: | |||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     name: Check licenses |     name: Check licenses | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v2 |       - uses: actions/checkout@v3 | ||||||
|       - run: npm ci |       - run: npm ci | ||||||
|       - run: npm run licensed-check |       - run: npm run licensed-check | ||||||
							
								
								
									
										10
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							| @@ -13,8 +13,8 @@ jobs: | |||||||
|     steps: |     steps: | ||||||
|       - uses: actions/setup-node@v1 |       - uses: actions/setup-node@v1 | ||||||
|         with: |         with: | ||||||
|           node-version: 12.x |           node-version: 16.x | ||||||
|       - uses: actions/checkout@v2 |       - uses: actions/checkout@v3 | ||||||
|       - run: npm ci |       - run: npm ci | ||||||
|       - run: npm run build |       - run: npm run build | ||||||
|       - run: npm run format-check |       - run: npm run format-check | ||||||
| @@ -32,7 +32,7 @@ jobs: | |||||||
|     steps: |     steps: | ||||||
|       # Clone this repo |       # Clone this repo | ||||||
|       - name: Checkout |       - name: Checkout | ||||||
|         uses: actions/checkout@v2 |         uses: actions/checkout@v3 | ||||||
|  |  | ||||||
|       # Basic checkout |       # Basic checkout | ||||||
|       - name: Checkout basic |       - name: Checkout basic | ||||||
| @@ -150,7 +150,7 @@ jobs: | |||||||
|     steps: |     steps: | ||||||
|       # Clone this repo |       # Clone this repo | ||||||
|       - name: Checkout |       - name: Checkout | ||||||
|         uses: actions/checkout@v2 |         uses: actions/checkout@v3 | ||||||
|  |  | ||||||
|       # Basic checkout using git |       # Basic checkout using git | ||||||
|       - name: Checkout basic |       - name: Checkout basic | ||||||
| @@ -182,7 +182,7 @@ jobs: | |||||||
|     steps: |     steps: | ||||||
|       # Clone this repo |       # Clone this repo | ||||||
|       - name: Checkout |       - name: Checkout | ||||||
|         uses: actions/checkout@v2 |         uses: actions/checkout@v3 | ||||||
|  |  | ||||||
|       # Basic checkout using git |       # Basic checkout using git | ||||||
|       - name: Checkout basic |       - name: Checkout basic | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								.licenses/npm/node-fetch.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/node-fetch.dep.yml
									
									
									
										generated
									
									
									
								
							| @@ -1,6 +1,6 @@ | |||||||
| --- | --- | ||||||
| name: node-fetch | name: node-fetch | ||||||
| version: 2.6.5 | version: 2.6.7 | ||||||
| type: npm | type: npm | ||||||
| summary: A light-weight module that brings window.fetch to node.js | summary: A light-weight module that brings window.fetch to node.js | ||||||
| homepage: https://github.com/bitinn/node-fetch | homepage: https://github.com/bitinn/node-fetch | ||||||
|   | |||||||
							
								
								
									
										15
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								CHANGELOG.md
									
									
									
									
									
								
							| @@ -1,19 +1,20 @@ | |||||||
| # Changelog | # Changelog | ||||||
|  |  | ||||||
| ## v2.5.0 | ## v3.0.2 | ||||||
| - [Bump @actions/core to v1.10.0](https://github.com/actions/checkout/pull/962) | - [Add input `set-safe-directory`](https://github.com/actions/checkout/pull/770) | ||||||
|  |  | ||||||
| ## v2.4.2 | ## v3.0.1 | ||||||
| - [Add input `set-safe-directory`](https://github.com/actions/checkout/pull/776) | - [Fixed an issue where checkout failed to run in container jobs due to the new git setting `safe.directory`](https://github.com/actions/checkout/pull/762) | ||||||
|  | - [Bumped various npm package versions](https://github.com/actions/checkout/pull/744) | ||||||
|  |  | ||||||
| ## v2.4.1 | ## v3.0.0 | ||||||
| - [Set the safe directory option on git to prevent git commands failing when running in containers](https://github.com/actions/checkout/pull/762) |  | ||||||
|  | - [Update to node 16](https://github.com/actions/checkout/pull/689) | ||||||
|  |  | ||||||
| ## v2.3.1 | ## v2.3.1 | ||||||
|  |  | ||||||
| - [Fix default branch resolution for .wiki and when using SSH](https://github.com/actions/checkout/pull/284) | - [Fix default branch resolution for .wiki and when using SSH](https://github.com/actions/checkout/pull/284) | ||||||
|  |  | ||||||
|  |  | ||||||
| ## v2.3.0 | ## v2.3.0 | ||||||
|  |  | ||||||
| - [Fallback to the default branch](https://github.com/actions/checkout/pull/278) | - [Fallback to the default branch](https://github.com/actions/checkout/pull/278) | ||||||
|   | |||||||
							
								
								
									
										45
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										45
									
								
								README.md
									
									
									
									
									
								
							| @@ -2,7 +2,7 @@ | |||||||
|   <a href="https://github.com/actions/checkout"><img alt="GitHub Actions status" src="https://github.com/actions/checkout/workflows/test-local/badge.svg"></a> |   <a href="https://github.com/actions/checkout"><img alt="GitHub Actions status" src="https://github.com/actions/checkout/workflows/test-local/badge.svg"></a> | ||||||
| </p> | </p> | ||||||
|  |  | ||||||
| # Checkout V2 | # Checkout V3 | ||||||
|  |  | ||||||
| This action checks-out your repository under `$GITHUB_WORKSPACE`, so your workflow can access it. | This action checks-out your repository under `$GITHUB_WORKSPACE`, so your workflow can access it. | ||||||
|  |  | ||||||
| @@ -14,27 +14,14 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl | |||||||
|  |  | ||||||
| # What's new | # What's new | ||||||
|  |  | ||||||
| - Improved performance | - Updated to the node16 runtime by default | ||||||
|   - Fetches only a single commit by default |   - This requires a minimum [Actions Runner](https://github.com/actions/runner/releases/tag/v2.285.0) version of v2.285.0 to run, which is by default available in GHES 3.4 or later. | ||||||
| - Script authenticated git commands |  | ||||||
|   - Auth token persisted in the local git config |  | ||||||
| - Supports SSH |  | ||||||
| - Creates a local branch |  | ||||||
|   - No longer detached HEAD when checking out a branch |  | ||||||
| - Improved layout |  | ||||||
|   - The input `path` is always relative to $GITHUB_WORKSPACE |  | ||||||
|   - Aligns better with container actions, where $GITHUB_WORKSPACE gets mapped in |  | ||||||
| - Fallback to REST API download |  | ||||||
|   - When Git 2.18 or higher is not in the PATH, the REST API will be used to download the files |  | ||||||
|   - When using a job container, the container's PATH is used |  | ||||||
|  |  | ||||||
| Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous versions. |  | ||||||
|  |  | ||||||
| # Usage | # Usage | ||||||
|  |  | ||||||
| <!-- start usage --> | <!-- start usage --> | ||||||
| ```yaml | ```yaml | ||||||
| - uses: actions/checkout@v2 | - uses: actions/checkout@v3 | ||||||
|   with: |   with: | ||||||
|     # Repository name with owner. For example, actions/checkout |     # Repository name with owner. For example, actions/checkout | ||||||
|     # Default: ${{ github.repository }} |     # Default: ${{ github.repository }} | ||||||
| @@ -128,7 +115,7 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous | |||||||
| ## Fetch all history for all tags and branches | ## Fetch all history for all tags and branches | ||||||
|  |  | ||||||
| ```yaml | ```yaml | ||||||
| - uses: actions/checkout@v2 | - uses: actions/checkout@v3 | ||||||
|   with: |   with: | ||||||
|     fetch-depth: 0 |     fetch-depth: 0 | ||||||
| ``` | ``` | ||||||
| @@ -136,7 +123,7 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous | |||||||
| ## Checkout a different branch | ## Checkout a different branch | ||||||
|  |  | ||||||
| ```yaml | ```yaml | ||||||
| - uses: actions/checkout@v2 | - uses: actions/checkout@v3 | ||||||
|   with: |   with: | ||||||
|     ref: my-branch |     ref: my-branch | ||||||
| ``` | ``` | ||||||
| @@ -144,7 +131,7 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous | |||||||
| ## Checkout HEAD^ | ## Checkout HEAD^ | ||||||
|  |  | ||||||
| ```yaml | ```yaml | ||||||
| - uses: actions/checkout@v2 | - uses: actions/checkout@v3 | ||||||
|   with: |   with: | ||||||
|     fetch-depth: 2 |     fetch-depth: 2 | ||||||
| - run: git checkout HEAD^ | - run: git checkout HEAD^ | ||||||
| @@ -154,12 +141,12 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous | |||||||
|  |  | ||||||
| ```yaml | ```yaml | ||||||
| - name: Checkout | - name: Checkout | ||||||
|   uses: actions/checkout@v2 |   uses: actions/checkout@v3 | ||||||
|   with: |   with: | ||||||
|     path: main |     path: main | ||||||
|  |  | ||||||
| - name: Checkout tools repo | - name: Checkout tools repo | ||||||
|   uses: actions/checkout@v2 |   uses: actions/checkout@v3 | ||||||
|   with: |   with: | ||||||
|     repository: my-org/my-tools |     repository: my-org/my-tools | ||||||
|     path: my-tools |     path: my-tools | ||||||
| @@ -169,10 +156,10 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous | |||||||
|  |  | ||||||
| ```yaml | ```yaml | ||||||
| - name: Checkout | - name: Checkout | ||||||
|   uses: actions/checkout@v2 |   uses: actions/checkout@v3 | ||||||
|  |  | ||||||
| - name: Checkout tools repo | - name: Checkout tools repo | ||||||
|   uses: actions/checkout@v2 |   uses: actions/checkout@v3 | ||||||
|   with: |   with: | ||||||
|     repository: my-org/my-tools |     repository: my-org/my-tools | ||||||
|     path: my-tools |     path: my-tools | ||||||
| @@ -182,12 +169,12 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous | |||||||
|  |  | ||||||
| ```yaml | ```yaml | ||||||
| - name: Checkout | - name: Checkout | ||||||
|   uses: actions/checkout@v2 |   uses: actions/checkout@v3 | ||||||
|   with: |   with: | ||||||
|     path: main |     path: main | ||||||
|  |  | ||||||
| - name: Checkout private tools | - name: Checkout private tools | ||||||
|   uses: actions/checkout@v2 |   uses: actions/checkout@v3 | ||||||
|   with: |   with: | ||||||
|     repository: my-org/my-private-tools |     repository: my-org/my-private-tools | ||||||
|     token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT |     token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT | ||||||
| @@ -200,7 +187,7 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous | |||||||
| ## Checkout pull request HEAD commit instead of merge commit | ## Checkout pull request HEAD commit instead of merge commit | ||||||
|  |  | ||||||
| ```yaml | ```yaml | ||||||
| - uses: actions/checkout@v2 | - uses: actions/checkout@v3 | ||||||
|   with: |   with: | ||||||
|     ref: ${{ github.event.pull_request.head.sha }} |     ref: ${{ github.event.pull_request.head.sha }} | ||||||
| ``` | ``` | ||||||
| @@ -216,7 +203,7 @@ jobs: | |||||||
|   build: |   build: | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v2 |       - uses: actions/checkout@v3 | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ## Push a commit using the built-in token | ## Push a commit using the built-in token | ||||||
| @@ -227,7 +214,7 @@ jobs: | |||||||
|   build: |   build: | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v2 |       - uses: actions/checkout@v3 | ||||||
|       - run: | |       - run: | | ||||||
|           date > generated.txt |           date > generated.txt | ||||||
|           git config user.name github-actions |           git config user.name github-actions | ||||||
|   | |||||||
| @@ -72,6 +72,6 @@ inputs: | |||||||
|     description: Add repository path as safe.directory for Git global config by running `git config --global --add safe.directory <path>` |     description: Add repository path as safe.directory for Git global config by running `git config --global --add safe.directory <path>` | ||||||
|     default: true |     default: true | ||||||
| runs: | runs: | ||||||
|   using: node12 |   using: node16 | ||||||
|   main: dist/index.js |   main: dist/index.js | ||||||
|   post: dist/index.js |   post: dist/index.js | ||||||
|   | |||||||
							
								
								
									
										2982
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2982
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										99
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										99
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @@ -5,28 +5,9 @@ | |||||||
|   "requires": true, |   "requires": true, | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "@actions/core": { |     "@actions/core": { | ||||||
|       "version": "1.10.0", |       "version": "1.2.6", | ||||||
|       "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", |       "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz", | ||||||
|       "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", |       "integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==" | ||||||
|       "requires": { |  | ||||||
|         "@actions/http-client": "^2.0.1", |  | ||||||
|         "uuid": "^8.3.2" |  | ||||||
|       }, |  | ||||||
|       "dependencies": { |  | ||||||
|         "@actions/http-client": { |  | ||||||
|           "version": "2.0.1", |  | ||||||
|           "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz", |  | ||||||
|           "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==", |  | ||||||
|           "requires": { |  | ||||||
|             "tunnel": "^0.0.6" |  | ||||||
|           } |  | ||||||
|         }, |  | ||||||
|         "uuid": { |  | ||||||
|           "version": "8.3.2", |  | ||||||
|           "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", |  | ||||||
|           "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" |  | ||||||
|         } |  | ||||||
|       } |  | ||||||
|     }, |     }, | ||||||
|     "@actions/exec": { |     "@actions/exec": { | ||||||
|       "version": "1.0.1", |       "version": "1.0.1", | ||||||
| @@ -1948,12 +1929,6 @@ | |||||||
|             "picomatch": "^2.2.3" |             "picomatch": "^2.2.3" | ||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "minimist": { |  | ||||||
|           "version": "1.2.5", |  | ||||||
|           "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", |  | ||||||
|           "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", |  | ||||||
|           "dev": true |  | ||||||
|         }, |  | ||||||
|         "normalize-path": { |         "normalize-path": { | ||||||
|           "version": "3.0.0", |           "version": "3.0.0", | ||||||
|           "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", |           "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", | ||||||
| @@ -3344,12 +3319,6 @@ | |||||||
|             "picomatch": "^2.2.3" |             "picomatch": "^2.2.3" | ||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "minimist": { |  | ||||||
|           "version": "1.2.5", |  | ||||||
|           "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", |  | ||||||
|           "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", |  | ||||||
|           "dev": true |  | ||||||
|         }, |  | ||||||
|         "normalize-path": { |         "normalize-path": { | ||||||
|           "version": "3.0.0", |           "version": "3.0.0", | ||||||
|           "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", |           "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", | ||||||
| @@ -5408,12 +5377,6 @@ | |||||||
|             "picomatch": "^2.2.3" |             "picomatch": "^2.2.3" | ||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "minimist": { |  | ||||||
|           "version": "1.2.5", |  | ||||||
|           "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", |  | ||||||
|           "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", |  | ||||||
|           "dev": true |  | ||||||
|         }, |  | ||||||
|         "normalize-path": { |         "normalize-path": { | ||||||
|           "version": "3.0.0", |           "version": "3.0.0", | ||||||
|           "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", |           "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", | ||||||
| @@ -7733,12 +7696,6 @@ | |||||||
|             "minimist": "^1.2.5" |             "minimist": "^1.2.5" | ||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "minimist": { |  | ||||||
|           "version": "1.2.5", |  | ||||||
|           "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", |  | ||||||
|           "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", |  | ||||||
|           "dev": true |  | ||||||
|         }, |  | ||||||
|         "semver": { |         "semver": { | ||||||
|           "version": "6.3.0", |           "version": "6.3.0", | ||||||
|           "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", |           "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", | ||||||
| @@ -9387,12 +9344,6 @@ | |||||||
|             "picomatch": "^2.2.3" |             "picomatch": "^2.2.3" | ||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "minimist": { |  | ||||||
|           "version": "1.2.5", |  | ||||||
|           "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", |  | ||||||
|           "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", |  | ||||||
|           "dev": true |  | ||||||
|         }, |  | ||||||
|         "normalize-path": { |         "normalize-path": { | ||||||
|           "version": "3.0.0", |           "version": "3.0.0", | ||||||
|           "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", |           "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", | ||||||
| @@ -11408,12 +11359,6 @@ | |||||||
|             "picomatch": "^2.2.3" |             "picomatch": "^2.2.3" | ||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "minimist": { |  | ||||||
|           "version": "1.2.5", |  | ||||||
|           "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", |  | ||||||
|           "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", |  | ||||||
|           "dev": true |  | ||||||
|         }, |  | ||||||
|         "normalize-path": { |         "normalize-path": { | ||||||
|           "version": "3.0.0", |           "version": "3.0.0", | ||||||
|           "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", |           "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", | ||||||
| @@ -12959,12 +12904,6 @@ | |||||||
|             "picomatch": "^2.2.3" |             "picomatch": "^2.2.3" | ||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "minimist": { |  | ||||||
|           "version": "1.2.5", |  | ||||||
|           "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", |  | ||||||
|           "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", |  | ||||||
|           "dev": true |  | ||||||
|         }, |  | ||||||
|         "normalize-path": { |         "normalize-path": { | ||||||
|           "version": "3.0.0", |           "version": "3.0.0", | ||||||
|           "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", |           "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", | ||||||
| @@ -13719,12 +13658,6 @@ | |||||||
|             "picomatch": "^2.2.3" |             "picomatch": "^2.2.3" | ||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "minimist": { |  | ||||||
|           "version": "1.2.5", |  | ||||||
|           "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", |  | ||||||
|           "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", |  | ||||||
|           "dev": true |  | ||||||
|         }, |  | ||||||
|         "normalize-path": { |         "normalize-path": { | ||||||
|           "version": "3.0.0", |           "version": "3.0.0", | ||||||
|           "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", |           "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", | ||||||
| @@ -14652,12 +14585,6 @@ | |||||||
|           "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", |           "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", | ||||||
|           "dev": true |           "dev": true | ||||||
|         }, |         }, | ||||||
|         "minimist": { |  | ||||||
|           "version": "1.2.5", |  | ||||||
|           "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", |  | ||||||
|           "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", |  | ||||||
|           "dev": true |  | ||||||
|         }, |  | ||||||
|         "normalize-path": { |         "normalize-path": { | ||||||
|           "version": "3.0.0", |           "version": "3.0.0", | ||||||
|           "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", |           "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", | ||||||
| @@ -15749,14 +15676,6 @@ | |||||||
|       "dev": true, |       "dev": true, | ||||||
|       "requires": { |       "requires": { | ||||||
|         "minimist": "^1.2.0" |         "minimist": "^1.2.0" | ||||||
|       }, |  | ||||||
|       "dependencies": { |  | ||||||
|         "minimist": { |  | ||||||
|           "version": "1.2.5", |  | ||||||
|           "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", |  | ||||||
|           "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", |  | ||||||
|           "dev": true |  | ||||||
|         } |  | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "kleur": { |     "kleur": { | ||||||
| @@ -15953,9 +15872,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "minimist": { |     "minimist": { | ||||||
|       "version": "1.2.5", |       "version": "1.2.6", | ||||||
|       "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", |       "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", | ||||||
|       "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", |       "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", | ||||||
|       "dev": true |       "dev": true | ||||||
|     }, |     }, | ||||||
|     "ms": { |     "ms": { | ||||||
| @@ -15976,9 +15895,9 @@ | |||||||
|       "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" |       "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" | ||||||
|     }, |     }, | ||||||
|     "node-fetch": { |     "node-fetch": { | ||||||
|       "version": "2.6.5", |       "version": "2.6.7", | ||||||
|       "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz", |       "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", | ||||||
|       "integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==", |       "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", | ||||||
|       "requires": { |       "requires": { | ||||||
|         "whatwg-url": "^5.0.0" |         "whatwg-url": "^5.0.0" | ||||||
|       }, |       }, | ||||||
|   | |||||||
| @@ -28,7 +28,7 @@ | |||||||
|   }, |   }, | ||||||
|   "homepage": "https://github.com/actions/checkout#readme", |   "homepage": "https://github.com/actions/checkout#readme", | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "@actions/core": "^1.10.0", |     "@actions/core": "^1.2.6", | ||||||
|     "@actions/exec": "^1.0.1", |     "@actions/exec": "^1.0.1", | ||||||
|     "@actions/github": "^2.2.0", |     "@actions/github": "^2.2.0", | ||||||
|     "@actions/io": "^1.0.1", |     "@actions/io": "^1.0.1", | ||||||
|   | |||||||
| @@ -120,7 +120,7 @@ function updateUsage( | |||||||
| } | } | ||||||
|  |  | ||||||
| updateUsage( | updateUsage( | ||||||
|   'actions/checkout@v2', |   'actions/checkout@v3', | ||||||
|   path.join(__dirname, '..', '..', 'action.yml'), |   path.join(__dirname, '..', '..', 'action.yml'), | ||||||
|   path.join(__dirname, '..', '..', 'README.md') |   path.join(__dirname, '..', '..', 'README.md') | ||||||
| ) | ) | ||||||
|   | |||||||
| @@ -5,4 +5,4 @@ set -e | |||||||
| src/misc/licensed-download.sh | src/misc/licensed-download.sh | ||||||
|  |  | ||||||
| echo 'Running: licensed cached' | echo 'Running: licensed cached' | ||||||
| _temp/licensed-3.3.1/licensed status | _temp/licensed-3.6.0/licensed status | ||||||
| @@ -2,23 +2,23 @@ | |||||||
|  |  | ||||||
| set -e | set -e | ||||||
|  |  | ||||||
| if [ ! -f _temp/licensed-3.3.1.done ]; then | if [ ! -f _temp/licensed-3.6.0.done ]; then | ||||||
|   echo 'Clearing temp' |   echo 'Clearing temp' | ||||||
|   rm -rf _temp/licensed-3.3.1 || true |   rm -rf _temp/licensed-3.6.0 || true | ||||||
|  |  | ||||||
|   echo 'Downloading licensed' |   echo 'Downloading licensed' | ||||||
|   mkdir -p _temp/licensed-3.3.1 |   mkdir -p _temp/licensed-3.6.0 | ||||||
|   pushd _temp/licensed-3.3.1 |   pushd _temp/licensed-3.6.0 | ||||||
|   if [[ "$OSTYPE" == "darwin"* ]]; then |   if [[ "$OSTYPE" == "darwin"* ]]; then | ||||||
|     curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/3.3.1/licensed-3.3.1-darwin-x64.tar.gz |     curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/3.6.0/licensed-3.6.0-darwin-x64.tar.gz | ||||||
|   else |   else | ||||||
|     curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/3.3.1/licensed-3.3.1-linux-x64.tar.gz |     curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/3.6.0/licensed-3.6.0-linux-x64.tar.gz | ||||||
|   fi |   fi | ||||||
|  |  | ||||||
|   echo 'Extracting licenesed' |   echo 'Extracting licenesed' | ||||||
|   tar -xzf licensed.tar.gz |   tar -xzf licensed.tar.gz | ||||||
|   popd |   popd | ||||||
|   touch _temp/licensed-3.3.1.done |   touch _temp/licensed-3.6.0.done | ||||||
| else | else | ||||||
|   echo 'Licensed already downloaded' |   echo 'Licensed already downloaded' | ||||||
| fi | fi | ||||||
|   | |||||||
| @@ -5,4 +5,4 @@ set -e | |||||||
| src/misc/licensed-download.sh | src/misc/licensed-download.sh | ||||||
|  |  | ||||||
| echo 'Running: licensed cached' | echo 'Running: licensed cached' | ||||||
| _temp/licensed-3.3.1/licensed cache | _temp/licensed-3.6.0/licensed cache | ||||||
| @@ -1,60 +1,71 @@ | |||||||
| import * as core from '@actions/core' | import * as coreCommand from '@actions/core/lib/command' | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Indicates whether the POST action is running |  * Indicates whether the POST action is running | ||||||
|  */ |  */ | ||||||
| export const IsPost = !!core.getState('isPost') | export const IsPost = !!process.env['STATE_isPost'] | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * The repository path for the POST action. The value is empty during the MAIN action. |  * The repository path for the POST action. The value is empty during the MAIN action. | ||||||
|  */ |  */ | ||||||
| export const RepositoryPath = core.getState('repositoryPath') | export const RepositoryPath = | ||||||
|  |   (process.env['STATE_repositoryPath'] as string) || '' | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action. |  * The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action. | ||||||
|  */ |  */ | ||||||
| export const PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true' | export const PostSetSafeDirectory = | ||||||
|  |   (process.env['STATE_setSafeDirectory'] as string) === 'true' | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * The SSH key path for the POST action. The value is empty during the MAIN action. |  * The SSH key path for the POST action. The value is empty during the MAIN action. | ||||||
|  */ |  */ | ||||||
| export const SshKeyPath = core.getState('sshKeyPath') | export const SshKeyPath = (process.env['STATE_sshKeyPath'] as string) || '' | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * The SSH known hosts path for the POST action. The value is empty during the MAIN action. |  * The SSH known hosts path for the POST action. The value is empty during the MAIN action. | ||||||
|  */ |  */ | ||||||
| export const SshKnownHostsPath = core.getState('sshKnownHostsPath') | export const SshKnownHostsPath = | ||||||
|  |   (process.env['STATE_sshKnownHostsPath'] as string) || '' | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Save the repository path so the POST action can retrieve the value. |  * Save the repository path so the POST action can retrieve the value. | ||||||
|  */ |  */ | ||||||
| export function setRepositoryPath(repositoryPath: string) { | export function setRepositoryPath(repositoryPath: string) { | ||||||
|   core.saveState('repositoryPath', repositoryPath) |   coreCommand.issueCommand( | ||||||
|  |     'save-state', | ||||||
|  |     {name: 'repositoryPath'}, | ||||||
|  |     repositoryPath | ||||||
|  |   ) | ||||||
| } | } | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Save the SSH key path so the POST action can retrieve the value. |  * Save the SSH key path so the POST action can retrieve the value. | ||||||
|  */ |  */ | ||||||
| export function setSshKeyPath(sshKeyPath: string) { | export function setSshKeyPath(sshKeyPath: string) { | ||||||
|   core.saveState('sshKeyPath', sshKeyPath) |   coreCommand.issueCommand('save-state', {name: 'sshKeyPath'}, sshKeyPath) | ||||||
| } | } | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Save the SSH known hosts path so the POST action can retrieve the value. |  * Save the SSH known hosts path so the POST action can retrieve the value. | ||||||
|  */ |  */ | ||||||
| export function setSshKnownHostsPath(sshKnownHostsPath: string) { | export function setSshKnownHostsPath(sshKnownHostsPath: string) { | ||||||
|   core.saveState('sshKnownHostsPath', sshKnownHostsPath) |   coreCommand.issueCommand( | ||||||
|  |     'save-state', | ||||||
|  |     {name: 'sshKnownHostsPath'}, | ||||||
|  |     sshKnownHostsPath | ||||||
|  |   ) | ||||||
| } | } | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Save the sef-safe-directory input so the POST action can retrieve the value. |  * Save the sef-safe-directory input so the POST action can retrieve the value. | ||||||
|  */ |  */ | ||||||
| export function setSafeDirectory() { | export function setSafeDirectory() { | ||||||
|   core.saveState('setSafeDirectory', 'true') |   coreCommand.issueCommand('save-state', {name: 'setSafeDirectory'}, 'true') | ||||||
| } | } | ||||||
|  |  | ||||||
| // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic. | // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic. | ||||||
| // This is necessary since we don't have a separate entry point. | // This is necessary since we don't have a separate entry point. | ||||||
| if (!IsPost) { | if (!IsPost) { | ||||||
|   core.saveState('isPost', 'true') |   coreCommand.issueCommand('save-state', {name: 'isPost'}, 'true') | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user