mirror of
				https://git.mirrors.martin98.com/https://github.com/docker/setup-docker-action
				synced 2025-10-31 08:51:09 +08:00 
			
		
		
		
	channel support
This commit is contained in:
		
							parent
							
								
									475e5bf1db
								
							
						
					
					
						commit
						59b62980d1
					
				
							
								
								
									
										20
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										20
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							| @ -30,3 +30,23 @@ jobs: | ||||
|         uses: ./ | ||||
|         with: | ||||
|           version: v23.0.0 | ||||
| 
 | ||||
|   channel: | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: | ||||
|           - ubuntu-latest | ||||
|           - macos-latest | ||||
|           - windows-latest | ||||
|     steps: | ||||
|       - | ||||
|         name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - | ||||
|         name: Set up Docker | ||||
|         uses: ./ | ||||
|         with: | ||||
|           version: v23.0.0-rc.4 | ||||
|           channel: test | ||||
|  | ||||
| @ -42,8 +42,9 @@ jobs: | ||||
| Following inputs can be used as `step.with` keys | ||||
| 
 | ||||
| | Name      | Type   | Default  | Description                                                                                       | | ||||
| |-----------|--------|----------|--------------------------------------| | ||||
| |-----------|--------|----------|---------------------------------------------------------------------------------------------------| | ||||
| | `version` | String | `latest` | Docker CE version (e.g., `v23.0.1`).                                                              | | ||||
| | `channel` | String | `stable` | Docker CE [channel](https://download.docker.com/linux/static/) (e.g, `stable`, `edge` or `test`). | | ||||
| 
 | ||||
| ## Contributing | ||||
| 
 | ||||
|  | ||||
| @ -21,6 +21,18 @@ describe('getInputs', () => { | ||||
|       ]), | ||||
|       { | ||||
|         version: 'v23.0.1', | ||||
|         channel: '', | ||||
|       } as context.Inputs | ||||
|     ], | ||||
|     [ | ||||
|       1, | ||||
|       new Map<string, string>([ | ||||
|         ['version', 'v23.0.0-rc.4'], | ||||
|         ['channel', 'test'], | ||||
|       ]), | ||||
|       { | ||||
|         version: 'v23.0.0-rc.4', | ||||
|         channel: 'test', | ||||
|       } as context.Inputs | ||||
|     ] | ||||
|   ])( | ||||
|  | ||||
| @ -10,6 +10,9 @@ inputs: | ||||
|   version: | ||||
|     description: 'Docker CE version. (e.g, v23.0.1)' | ||||
|     required: false | ||||
|   channel: | ||||
|     description: 'Docker CE channel. (e.g, stable, edge or test)' | ||||
|     required: false | ||||
| 
 | ||||
| runs: | ||||
|   using: 'node16' | ||||
|  | ||||
| @ -2,10 +2,12 @@ import * as core from '@actions/core'; | ||||
| 
 | ||||
| export interface Inputs { | ||||
|   version: string; | ||||
|   channel: string; | ||||
| } | ||||
| 
 | ||||
| export function getInputs(): Inputs { | ||||
|   return { | ||||
|     version: core.getInput('version') | ||||
|     version: core.getInput('version'), | ||||
|     channel: core.getInput('channel') | ||||
|   }; | ||||
| } | ||||
|  | ||||
| @ -17,7 +17,8 @@ actionsToolkit.run( | ||||
| 
 | ||||
|     const install = new Install({ | ||||
|       runDir: runDir, | ||||
|       version: input.version | ||||
|       version: input.version, | ||||
|       channel: input.channel | ||||
|     }); | ||||
|     let toolDir; | ||||
|     if (!(await Docker.isAvailable()) || input.version) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 CrazyMax
						CrazyMax