Merge pull request #6 from crazy-max/channel

channel support
This commit is contained in:
CrazyMax 2023-03-10 00:08:13 +00:00 committed by GitHub
commit 3dcc76c352
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 46 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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
]
])(

View File

@ -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
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -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')
};
}

View File

@ -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) {