mirror of
				https://github.com/actions/checkout.git
				synced 2025-10-31 18:18:37 +08:00 
			
		
		
		
	TO-DROP: run only test-proxy
				
					
				
			Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
		
							parent
							
								
									37805d21bd
								
							
						
					
					
						commit
						ebe32779b0
					
				
							
								
								
									
										51
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										51
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
								
							|  | @ -1,51 +0,0 @@ | ||||||
| # `dist/index.js` is a special file in Actions. |  | ||||||
| # When you reference an action with `uses:` in a workflow, |  | ||||||
| # `index.js` is the code that will run. |  | ||||||
| # For our project, we generate this file through a build process |  | ||||||
| # from other source files. |  | ||||||
| # We need to make sure the checked-in `index.js` actually matches what we expect it to be. |  | ||||||
| name: Check dist |  | ||||||
| 
 |  | ||||||
| on: |  | ||||||
|   push: |  | ||||||
|     branches: |  | ||||||
|       - main |  | ||||||
|     paths-ignore: |  | ||||||
|       - '**.md' |  | ||||||
|   pull_request: |  | ||||||
|     paths-ignore: |  | ||||||
|       - '**.md' |  | ||||||
|   workflow_dispatch: |  | ||||||
| 
 |  | ||||||
| jobs: |  | ||||||
|   check-dist: |  | ||||||
|     runs-on: ubuntu-latest |  | ||||||
| 
 |  | ||||||
|     steps: |  | ||||||
|       - uses: actions/checkout@v3 |  | ||||||
| 
 |  | ||||||
|       - name: Set Node.js 20.x |  | ||||||
|         uses: actions/setup-node@v1 |  | ||||||
|         with: |  | ||||||
|           node-version: 20.x |  | ||||||
| 
 |  | ||||||
|       - name: Install dependencies |  | ||||||
|         run: npm ci |  | ||||||
| 
 |  | ||||||
|       - name: Rebuild the index.js file |  | ||||||
|         run: npm run build |  | ||||||
| 
 |  | ||||||
|       - name: Compare the expected and actual dist/ directories |  | ||||||
|         run: | |  | ||||||
|           if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then |  | ||||||
|             echo "Detected uncommitted changes after build.  See status below:" |  | ||||||
|             git diff |  | ||||||
|             exit 1 |  | ||||||
|           fi |  | ||||||
| 
 |  | ||||||
|       # If dist/ was different than expected, upload the expected version as an artifact |  | ||||||
|       - uses: actions/upload-artifact@v2 |  | ||||||
|         if: ${{ failure() && steps.diff.conclusion == 'failure' }} |  | ||||||
|         with: |  | ||||||
|           name: dist |  | ||||||
|           path: dist/ |  | ||||||
							
								
								
									
										58
									
								
								.github/workflows/codeql-analysis.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										58
									
								
								.github/workflows/codeql-analysis.yml
									
									
									
									
										vendored
									
									
								
							|  | @ -1,58 +0,0 @@ | ||||||
| # For most projects, this workflow file will not need changing; you simply need |  | ||||||
| # to commit it to your repository. |  | ||||||
| # |  | ||||||
| # You may wish to alter this file to override the set of languages analyzed, |  | ||||||
| # or to provide custom queries or build logic. |  | ||||||
| # |  | ||||||
| # ******** NOTE ******** |  | ||||||
| # We have attempted to detect the languages in your repository. Please check |  | ||||||
| # the `language` matrix defined below to confirm you have the correct set of |  | ||||||
| # supported CodeQL languages. |  | ||||||
| # |  | ||||||
| name: "CodeQL" |  | ||||||
| 
 |  | ||||||
| on: |  | ||||||
|   push: |  | ||||||
|     branches: [ main ] |  | ||||||
|   pull_request: |  | ||||||
|     # The branches below must be a subset of the branches above |  | ||||||
|     branches: [ main ] |  | ||||||
|   schedule: |  | ||||||
|     - cron: '28 9 * * 0' |  | ||||||
| 
 |  | ||||||
| jobs: |  | ||||||
|   analyze: |  | ||||||
|     name: Analyze |  | ||||||
|     runs-on: ubuntu-latest |  | ||||||
|     permissions: |  | ||||||
|       actions: read |  | ||||||
|       contents: read |  | ||||||
|       security-events: write |  | ||||||
| 
 |  | ||||||
|     strategy: |  | ||||||
|       fail-fast: false |  | ||||||
|       matrix: |  | ||||||
|         language: [ 'javascript' ] |  | ||||||
|         # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] |  | ||||||
|         # Learn more: |  | ||||||
|         # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed |  | ||||||
| 
 |  | ||||||
|     steps: |  | ||||||
|     - name: Checkout repository |  | ||||||
|       uses: actions/checkout@v3 |  | ||||||
| 
 |  | ||||||
|     - name: Initialize CodeQL |  | ||||||
|       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. |  | ||||||
|         # By default, queries listed here will override any specified in a config file. |  | ||||||
|         # Prefix the list here with "+" to use these queries and those in the config file. |  | ||||||
|         # queries: ./path/to/local/query, your-org/your-repo/queries@main |  | ||||||
| 
 |  | ||||||
|     - run: npm ci |  | ||||||
|     - run: npm run build |  | ||||||
|     - run: rm -rf dist # We want code scanning to analyze lib instead (individual .js files) |  | ||||||
| 
 |  | ||||||
|     - name: Perform CodeQL Analysis |  | ||||||
|       uses: github/codeql-action/analyze@v2 |  | ||||||
							
								
								
									
										14
									
								
								.github/workflows/licensed.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								.github/workflows/licensed.yml
									
									
									
									
										vendored
									
									
								
							|  | @ -1,14 +0,0 @@ | ||||||
| name: Licensed |  | ||||||
| 
 |  | ||||||
| on: |  | ||||||
|   push: {branches: main} |  | ||||||
|   pull_request: {branches: main} |  | ||||||
| 
 |  | ||||||
| jobs: |  | ||||||
|   test: |  | ||||||
|     runs-on: ubuntu-latest |  | ||||||
|     name: Check licenses |  | ||||||
|     steps: |  | ||||||
|       - uses: actions/checkout@v3 |  | ||||||
|       - run: npm ci |  | ||||||
|       - run: npm run licensed-check |  | ||||||
							
								
								
									
										234
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										234
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							|  | @ -8,170 +8,6 @@ on: | ||||||
|       - releases/* |       - releases/* | ||||||
| 
 | 
 | ||||||
| jobs: | jobs: | ||||||
|   build: |  | ||||||
|     runs-on: ubuntu-latest |  | ||||||
|     steps: |  | ||||||
|       - uses: actions/setup-node@v1 |  | ||||||
|         with: |  | ||||||
|           node-version: 20.x |  | ||||||
|       - uses: actions/checkout@v3 |  | ||||||
|       - run: npm ci |  | ||||||
|       - run: npm run build |  | ||||||
|       - run: npm run format-check |  | ||||||
|       - run: npm run lint |  | ||||||
|       - run: npm test |  | ||||||
|       - name: Verify no unstaged changes |  | ||||||
|         run: __test__/verify-no-unstaged-changes.sh |  | ||||||
| 
 |  | ||||||
|   test: |  | ||||||
|     strategy: |  | ||||||
|       matrix: |  | ||||||
|         runs-on: [ubuntu-latest, macos-latest, windows-latest] |  | ||||||
|     runs-on: ${{ matrix.runs-on }} |  | ||||||
| 
 |  | ||||||
|     steps: |  | ||||||
|       # Clone this repo |  | ||||||
|       - name: Checkout |  | ||||||
|         uses: actions/checkout@v3 |  | ||||||
| 
 |  | ||||||
|       # Basic checkout |  | ||||||
|       - name: Checkout basic |  | ||||||
|         uses: ./ |  | ||||||
|         with: |  | ||||||
|           ref: test-data/v2/basic |  | ||||||
|           path: basic |  | ||||||
|       - name: Verify basic |  | ||||||
|         shell: bash |  | ||||||
|         run: __test__/verify-basic.sh |  | ||||||
| 
 |  | ||||||
|       # Clean |  | ||||||
|       - name: Modify work tree |  | ||||||
|         shell: bash |  | ||||||
|         run: __test__/modify-work-tree.sh |  | ||||||
|       - name: Checkout clean |  | ||||||
|         uses: ./ |  | ||||||
|         with: |  | ||||||
|           ref: test-data/v2/basic |  | ||||||
|           path: basic |  | ||||||
|       - name: Verify clean |  | ||||||
|         shell: bash |  | ||||||
|         run: __test__/verify-clean.sh |  | ||||||
| 
 |  | ||||||
|       # Side by side |  | ||||||
|       - name: Checkout side by side 1 |  | ||||||
|         uses: ./ |  | ||||||
|         with: |  | ||||||
|           ref: test-data/v2/side-by-side-1 |  | ||||||
|           path: side-by-side-1 |  | ||||||
|       - name: Checkout side by side 2 |  | ||||||
|         uses: ./ |  | ||||||
|         with: |  | ||||||
|           ref: test-data/v2/side-by-side-2 |  | ||||||
|           path: side-by-side-2 |  | ||||||
|       - name: Verify side by side |  | ||||||
|         shell: bash |  | ||||||
|         run: __test__/verify-side-by-side.sh |  | ||||||
| 
 |  | ||||||
|       # Filter |  | ||||||
|       - name: Fetch filter |  | ||||||
|         uses: ./ |  | ||||||
|         with: |  | ||||||
|           filter: 'blob:none' |  | ||||||
|           path: fetch-filter |  | ||||||
| 
 |  | ||||||
|       - name: Verify fetch filter |  | ||||||
|         run: __test__/verify-fetch-filter.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: ./ |  | ||||||
|         with: |  | ||||||
|           repository: actions/checkout # hardcoded, otherwise doesn't work from a fork |  | ||||||
|           ref: test-data/v2/lfs |  | ||||||
|           path: lfs |  | ||||||
|           lfs: true |  | ||||||
|       - name: Verify LFS |  | ||||||
|         shell: bash |  | ||||||
|         run: __test__/verify-lfs.sh |  | ||||||
| 
 |  | ||||||
|       # Submodules false |  | ||||||
|       - name: Checkout submodules false |  | ||||||
|         uses: ./ |  | ||||||
|         with: |  | ||||||
|           ref: test-data/v2/submodule-ssh-url |  | ||||||
|           path: submodules-false |  | ||||||
|       - name: Verify submodules false |  | ||||||
|         run: __test__/verify-submodules-false.sh |  | ||||||
| 
 |  | ||||||
|       # Submodules one level |  | ||||||
|       - name: Checkout submodules true |  | ||||||
|         uses: ./ |  | ||||||
|         with: |  | ||||||
|           ref: test-data/v2/submodule-ssh-url |  | ||||||
|           path: submodules-true |  | ||||||
|           submodules: true |  | ||||||
|       - name: Verify submodules true |  | ||||||
|         run: __test__/verify-submodules-true.sh |  | ||||||
| 
 |  | ||||||
|       # Submodules recursive |  | ||||||
|       - name: Checkout submodules recursive |  | ||||||
|         uses: ./ |  | ||||||
|         with: |  | ||||||
|           ref: test-data/v2/submodule-ssh-url |  | ||||||
|           path: submodules-recursive |  | ||||||
|           submodules: recursive |  | ||||||
|       - name: Verify submodules recursive |  | ||||||
|         run: __test__/verify-submodules-recursive.sh |  | ||||||
| 
 |  | ||||||
|       # Basic checkout using REST API |  | ||||||
|       - name: Remove basic |  | ||||||
|         if: runner.os != 'windows' |  | ||||||
|         run: rm -rf basic |  | ||||||
|       - name: Remove basic (Windows) |  | ||||||
|         if: runner.os == 'windows' |  | ||||||
|         shell: cmd |  | ||||||
|         run: rmdir /s /q basic |  | ||||||
|       - name: Override git version |  | ||||||
|         if: runner.os != 'windows' |  | ||||||
|         run: __test__/override-git-version.sh |  | ||||||
|       - name: Override git version (Windows) |  | ||||||
|         if: runner.os == 'windows' |  | ||||||
|         run: __test__\\override-git-version.cmd |  | ||||||
|       - name: Checkout basic using REST API |  | ||||||
|         uses: ./ |  | ||||||
|         with: |  | ||||||
|           ref: test-data/v2/basic |  | ||||||
|           path: basic |  | ||||||
|       - name: Verify basic |  | ||||||
|         run: __test__/verify-basic.sh --archive |  | ||||||
| 
 |  | ||||||
|   test-proxy: |   test-proxy: | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     container: |     container: | ||||||
|  | @ -210,73 +46,3 @@ jobs: | ||||||
|           path: basic |           path: basic | ||||||
|       - name: Verify basic |       - name: Verify basic | ||||||
|         run: __test__/verify-basic.sh --archive |         run: __test__/verify-basic.sh --archive | ||||||
| 
 |  | ||||||
|   test-bypass-proxy: |  | ||||||
|     runs-on: ubuntu-latest |  | ||||||
|     env: |  | ||||||
|       https_proxy: http://no-such-proxy:3128 |  | ||||||
|       no_proxy: api.github.com,github.com |  | ||||||
|     steps: |  | ||||||
|       # Clone this repo |  | ||||||
|       - name: Checkout |  | ||||||
|         uses: actions/checkout@v3 |  | ||||||
| 
 |  | ||||||
|       # Basic checkout using git |  | ||||||
|       - name: Checkout basic |  | ||||||
|         uses: ./ |  | ||||||
|         with: |  | ||||||
|           ref: test-data/v2/basic |  | ||||||
|           path: basic |  | ||||||
|       - name: Verify basic |  | ||||||
|         run: __test__/verify-basic.sh |  | ||||||
|       - name: Remove basic |  | ||||||
|         run: rm -rf basic |  | ||||||
| 
 |  | ||||||
|       # Basic checkout using REST API |  | ||||||
|       - name: Override git version |  | ||||||
|         run: __test__/override-git-version.sh |  | ||||||
|       - name: Checkout basic using REST API |  | ||||||
|         uses: ./ |  | ||||||
|         with: |  | ||||||
|           ref: test-data/v2/basic |  | ||||||
|           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 |  | ||||||
							
								
								
									
										32
									
								
								.github/workflows/update-main-version.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										32
									
								
								.github/workflows/update-main-version.yml
									
									
									
									
										vendored
									
									
								
							|  | @ -1,32 +0,0 @@ | ||||||
| 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: |  | ||||||
|           - v4 |  | ||||||
|           - 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 |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Johannes Schindelin
						Johannes Schindelin