channel support

This commit is contained in:
CrazyMax 2023-03-10 00:40:26 +01:00
parent 475e5bf1db
commit 59b62980d1
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
6 changed files with 44 additions and 5 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

@ -41,9 +41,10 @@ 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`). |
| 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'

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