diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d50d109..e69de29 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,34 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve ---- - -### Behaviour - -#### Steps to reproduce this issue - -1. -2. -3. - -#### Expected behaviour - -> Tell us what should happen - -#### Actual behaviour - -> Tell us what happens instead - -### Configuration - -* Repository URL (if public): -* Build URL (if public): - -```yml -# paste your YAML workflow file here and remove sensitive data -``` - -### Logs - -> Download the [log file of your build](https://docs.github.com/en/actions/managing-workflow-runs/using-workflow-run-logs#downloading-logs) -> and [attach it](https://docs.github.com/en/github/managing-your-work-on-github/file-attachments-on-issues-and-pull-requests) to this issue. diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md deleted file mode 100644 index 24fa7ca..0000000 --- a/.github/SUPPORT.md +++ /dev/null @@ -1,31 +0,0 @@ -# Support [![](https://isitmaintained.com/badge/resolution/step-security/ghaction-setup-docker.svg)](https://isitmaintained.com/project/step-security/ghaction-setup-docker) - -First, [be a good guy](https://github.com/kossnocorp/etiquette/blob/master/README.md). - -## Reporting an issue - -Please do a search in [open issues](https://github.com/step-security/ghaction-setup-docker/issues?utf8=%E2%9C%93&q=) to see if the issue or feature request has already been filed. - -If you find your issue already exists, make relevant comments and add your [reaction](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments). Use a reaction in place of a "+1" comment. - -:+1: - upvote - -:-1: - downvote - -If you cannot find an existing issue that describes your bug or feature, submit an issue using the guidelines below. - -## Writing good bug reports and feature requests - -File a single issue per problem and feature request. - -* Do not enumerate multiple bugs or feature requests in the same issue. -* Do not add your issue as a comment to an existing issue unless it's for the identical input. Many issues look similar, but have different causes. - -The more information you can provide, the more likely someone will be successful reproducing the issue and finding a fix. - -You are now ready to [create a new issue](https://github.com/step-security/ghaction-setup-docker/issues/new/choose)! - -## Closure policy - -* Issues that don't have the information requested above (when applicable) will be closed immediately and the poster directed to the support guidelines. -* Issues that go a week without a response from original poster are subject to closure at our discretion. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6bb7255..a22ad69 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,6 +4,11 @@ updates: directory: "/" schedule: interval: "daily" + ignore: + # ignore this dependency + # it seems a bug with dependabot as pining to commit sha should not + # trigger a new version similar to https://github.com/docker/buildx/pull/2222#issuecomment-1919092153 + - dependency-name: "docker/actions-toolkit" labels: - "dependencies" - "bot" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f611a5..3d6687a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,8 @@ on: pull_request: env: - DOCKER_VERSION: v24.0.9 + DOCKER_VERSION: v27.3.1 + DOCKER_BUILD_SUMMARY: false jobs: main: @@ -27,10 +28,12 @@ jobs: matrix: os: - ubuntu-latest + - ubuntu-24.04-arm + #- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 - windows-latest version: - - pinned - - latest + - v27.3.1 + - type=image,tag=27.3.1 include: - os: macos-13 version: pinned @@ -43,22 +46,11 @@ jobs: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - name: Set version - shell: bash - run: | - if [ "${{ matrix.version }}" != "pinned" ]; then - echo "DOCKER_VERSION=${{ matrix.version }}" >> $GITHUB_ENV - fi - name: Set up Docker uses: ./ with: - version: ${{ env.DOCKER_VERSION }} - - - name: Dump context - if: always() - uses: crazy-max/ghaction-dump-context@5355a8e5e6ac5a302e746a1c4b7747a0393863c8 # v2.3.0 + version: ${{ matrix.version }} channel: runs-on: ${{ matrix.os }} @@ -67,6 +59,7 @@ jobs: matrix: os: - ubuntu-latest + - ubuntu-24.04-arm #- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 - windows-latest steps: @@ -82,7 +75,7 @@ jobs: name: Set up Docker uses: ./ with: - version: v24.0.0-rc.4 + version: ${{ env.DOCKER_VERSION }} channel: test - name: Dump context @@ -96,6 +89,7 @@ jobs: matrix: os: - ubuntu-latest + - ubuntu-24.04-arm #- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 - windows-latest steps: @@ -111,6 +105,7 @@ jobs: name: Set up Docker uses: ./ with: + version: ${{ env.DOCKER_VERSION }} daemon-config: | { "debug": true, @@ -130,6 +125,7 @@ jobs: matrix: os: - ubuntu-latest + - ubuntu-24.04-arm #- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 - macos-13 - windows-latest @@ -172,6 +168,8 @@ jobs: - name: Set up Docker uses: ./ + with: + version: ${{ env.DOCKER_VERSION }} env: LIMA_START_ARGS: --cpus 4 --memory 8 @@ -323,12 +321,55 @@ jobs: name: Set up Docker uses: ./ with: + version: ${{ env.DOCKER_VERSION }} set-host: true - name: List contexts run: | docker context ls + + rootless: + runs-on: ubuntu-latest + steps: - - name: Dump context - if: always() - uses: crazy-max/ghaction-dump-context@5355a8e5e6ac5a302e746a1c4b7747a0393863c8 # v2.3.0 + name: Checkout + uses: actions/checkout@v4 + - + name: Set up Docker + uses: ./ + with: + version: ${{ env.DOCKER_VERSION }} + rootless: true + - + name: List contexts + run: | + docker context ls + + tcp: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - ubuntu-24.04-arm + #- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 + - macos-13 + - windows-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Set up Docker + id: setup_docker + uses: ./ + with: + version: ${{ env.DOCKER_VERSION }} + tcp-port: 2378 + - + name: Check docker info through TCP + run: | + docker info + env: + DOCKER_HOST: ${{ steps.setup_docker.outputs.tcp }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cef8ead..cb8f173 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,17 +20,14 @@ jobs: with: egress-policy: audit - - - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Test - uses: docker/bake-action@f6acc70fe0da9b200315017ca49a08c0de03aa0b # v5.1.0 + uses: docker/bake-action@v6 with: targets: test - name: Upload coverage uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 with: - file: ./coverage/clover.xml + files: ./coverage/clover.xml token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 7cb829d..226acf6 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -15,7 +15,7 @@ jobs: prepare: runs-on: ubuntu-latest outputs: - targets: ${{ steps.targets.outputs.matrix }} + targets: ${{ steps.generate.outputs.targets }} steps: - name: Harden Runner uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 @@ -26,10 +26,11 @@ jobs: name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - name: Targets matrix - id: targets - run: | - echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT + name: List targets + id: generate + uses: docker/bake-action/subaction/list-targets@v6 + with: + target: validate validate: runs-on: ubuntu-latest @@ -45,11 +46,8 @@ jobs: with: egress-policy: audit - - - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Validate - uses: docker/bake-action@f6acc70fe0da9b200315017ca49a08c0de03aa0b # v5.1.0 + uses: docker/bake-action@v6 with: targets: ${{ matrix.target }} diff --git a/README.md b/README.md index 55ff2fb..08ffbed 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,13 @@ GitHub Action to set up (download and install) [Docker CE](https://docs.docker.com/engine/). Works on Linux, macOS and Windows. +> [!NOTE] +> This action is useful if you want to pin against a specific Docker version or +> set up a custom daemon configuration or if Docker is not available on your +> runner. If you're using [GitHub-hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources) +> on Linux or Windows, Docker is already up and running, so it might not be +> necessary to use this action. + > [!WARNING] > Does not work on macOS runners with ARM architecture (no nested virtualization): > * https://github.com/docker/actions-toolkit/issues/317 @@ -23,6 +30,7 @@ ___ * [Define custom `limactl start` arguments (macOS)](#define-custom-limactl-start-arguments-macos) * [Customizing](#customizing) * [inputs](#inputs) + * [inputs.version](#inputsversion) * [outputs](#outputs) * [Contributing](#contributing) * [License](#license) @@ -43,7 +51,7 @@ jobs: steps: - name: Set up Docker - uses: step-security/ghaction-setup-docker@v3 + uses: step-security/ghaction-setup-docker@4 ``` ### Daemon configuration @@ -65,7 +73,7 @@ jobs: steps: - name: Set up Docker - uses: step-security/ghaction-setup-docker@v3 + uses: step-security/ghaction-setup-docker@4 with: daemon-config: | { @@ -93,7 +101,7 @@ jobs: steps: - name: Set up Docker - uses: step-security/ghaction-setup-docker@v3 + uses: step-security/ghaction-setup-docker@4 env: LIMA_START_ARGS: --cpus 4 --memory 8 ``` @@ -106,19 +114,88 @@ The following inputs can be used as `step.with` keys | Name | Type | Default | Description | |-----------------|--------|-----------------------|-----------------------------------------------------------------------------------------------------------------------------| -| `version` | String | `latest` | Docker CE version (e.g., `v24.0.6`). | -| `channel` | String | `stable` | Docker CE [channel](https://download.docker.com/linux/static/) (e.g, `stable`, `edge` or `test`). | +| `version` | String | `latest` | Docker version to use. See [inputs.version](#inputs.version). | +| `channel` | String | `stable` | Docker CE [channel](https://download.docker.com/linux/static/) (`stable` or `test`). Only applicable to `type=archive` | | `daemon-config` | String | | [Docker daemon JSON configuration](https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file) | +| `tcp-port` | Number | | TCP port to expose the Docker API locally | | `context` | String | `setup-docker-action` | Docker context name. | | `set-host` | Bool | `false` | Set `DOCKER_HOST` environment variable to docker socket path. | +| `rootless` | Bool | `false` | Start daemon in rootless mode | + +### inputs.version + +By default, the latest stable version of Docker is fetched from download.docker.com. + +You can specify a specific version number (e.g. `v27.4.0`). +Which is a shorthand for the full comma separated value: + +`type=archive,channel=stable,version=v27.4.0` + +You can also use this full csv format instead. + +Currently supported source types are: +- `archive` +- `image` + +#### `type=archive` +| Key | Default | Description | +|-----------|------------|--------------------------------------------------------------------------------------| +| `type` | `archive` | The source type of the Docker binaries. Possible values are `archive` and `image`. | +| `channel` | `stable` | The download.docker.com channel (`stable` or `test`). | +| `version` | `latest` | The Docker version to use. | + +Examples: +```yaml +# last stable released version +version: latest +version: type=archive # same as above +version: version=latest # same as above +version: type=archive,version=latest # same as above +``` + +```yaml +# v27.3.0-rc.1 from test channel +version: type=archive,version=27.3.0-rc.1,channel=test +``` + +#### `type=image` + +Other possible source type is `image` which will pull the Docker binaries from the `moby/moby-bin` and +`dockereng/cli-bin` Docker Hub repositories. +The advantage of using this source type is that these images are built by the Moby and Docker CI pipelines +for each branch and PR, so you can use the `tag` input to install a specific version or branch (e.g. `master`). + +| Key | Default | Description | +|-----------|------------|--------------------------------------------------------------------------------------| +| `tag` | `latest` | The image tag to use. | + +See https://hub.docker.com/r/moby/moby-bin/tags and https://hub.docker.com/r/dockereng/cli-bin/tags for available tags. + +Examples: +```yaml +# install last stable released version from bin images +version: type=image +version: type=image,tag=latest # same as above +``` + +```yaml +# a cutting-edge version from the `master` branch +version: type=image,tag=master +``` + +```yaml +# install v27.4.0 from bin images +version: type=image,tag=27.4.0 +``` ### outputs The following outputs are available -| Name | Type | Description | -|--------|--------|--------------------| -| `sock` | String | Docker socket path | +| Name | Type | Description | +|--------|--------|---------------------------------------| +| `sock` | String | Docker socket path | +| `tcp` | String | Docker TCP address if tcp-port is set | ## License diff --git a/__tests__/context.test.ts b/__tests__/context.test.ts index 5e813ac..868b17e 100644 --- a/__tests__/context.test.ts +++ b/__tests__/context.test.ts @@ -19,12 +19,17 @@ describe('getInputs', () => { new Map([ ['version', 'v24.0.8'], ['set-host', 'false'], + ['rootless', 'false'], ]), { - version: 'v24.0.8', - channel: '', + source: { + type: 'archive', + version: 'v24.0.8', + channel: 'stable' + }, context: '', daemonConfig: '', + rootless: false, setHost: false } as context.Inputs ], @@ -36,12 +41,17 @@ describe('getInputs', () => { ['context', 'foo'], ['daemon-config', `{"debug":true,"features":{"containerd-snapshotter":true}}`], ['set-host', 'false'], + ['rootless', 'false'], ]), { - version: 'v24.0.0-rc.4', - channel: 'test', + source: { + type: 'archive', + version: 'v24.0.0-rc.4', + channel: 'test' + }, context: 'foo', daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`, + rootless: false, setHost: false } as context.Inputs ], @@ -49,15 +59,153 @@ describe('getInputs', () => { 2, new Map([ ['set-host', 'true'], + ['rootless', 'false'], ]), { - version: 'latest', - channel: '', + source: { + type: 'archive', + version: 'latest', + channel: 'stable', + }, context: '', daemonConfig: '', + rootless: false, setHost: true } as context.Inputs - ] + ], + [ + 3, + new Map([ + ['version', 'type=image,tag=master'], + ['context', 'foo'], + ['daemon-config', `{"debug":true,"features":{"containerd-snapshotter":true}}`], + ['set-host', 'false'], + ['rootless', 'false'], + ]), + { + source: { + type: 'image', + tag: 'master', + }, + context: 'foo', + daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`, + rootless: false, + setHost: false + } as context.Inputs + ], + [ + 4, + new Map([ + ['version', 'type=image'], + ['set-host', 'false'], + ['rootless', 'false'], + ]), + { + source: { + type: 'image', + tag: 'latest', + }, + context: '', + daemonConfig: '', + rootless: false, + setHost: false + } as context.Inputs + ], + [ + 5, + new Map([ + ['version', 'type=archive'], + ['set-host', 'false'], + ['rootless', 'false'], + ]), + { + source: { + type: 'archive', + version: 'latest', + channel: 'stable', + }, + setHost: false, + context: '', + daemonConfig: '', + rootless: false, + } as context.Inputs + ], + [ + 6, + new Map([ + ['version', 'version=v27.2.0,channel=test'], + ['set-host', 'false'], + ['rootless', 'false'], + ]), + { + source: { + type: 'archive', + version: 'v27.2.0', + channel: 'test', + }, + setHost: false, + context: '', + daemonConfig: '', + rootless: false, + } as context.Inputs + ], + [ + 7, + new Map([ + ['version', 'type=image,tag=27.2.1'], + ['set-host', 'false'], + ['rootless', 'false'], + ]), + { + source: { + type: 'image', + tag: '27.2.1', + }, + setHost: false, + context: '', + daemonConfig: '', + rootless: false, + } as context.Inputs + ], + [ + 8, + new Map([ + ['version', 'type=image,tag=27.2.1'], + ['set-host', 'false'], + ['rootless', 'true'] + ]), + { + source: { + type: 'image', + tag: '27.2.1', + }, + setHost: false, + context: '', + daemonConfig: '', + rootless: true, + } as context.Inputs + ], + [ + 9, + new Map([ + ['version', 'v24.0.8'], + ['tcp-port', '2378'], + ['set-host', 'false'], + ['rootless', 'false'], + ]), + { + source: { + type: 'archive', + version: 'v24.0.8', + channel: 'stable' + }, + context: '', + daemonConfig: '', + tcpPort: 2378, + rootless: false, + setHost: false + } as context.Inputs + ], ])( '[%d] given %p as inputs, returns %p', async (num: number, inputs: Map, expected: context.Inputs) => { diff --git a/action.yml b/action.yml index 3518588..f9ccd9a 100644 --- a/action.yml +++ b/action.yml @@ -1,6 +1,7 @@ # https://help.github.com/en/articles/metadata-syntax-for-github-actions -name: 'Docker Setup Docker' -description: 'Set up Docker for use in GitHub Actions by downloading and installing a version of Docker CE' +name: Docker Setup Docker +description: Set up Docker for use in GitHub Actions by downloading and installing a version of Docker CE +author: step-security branding: icon: 'anchor' color: 'blue' @@ -16,6 +17,9 @@ inputs: daemon-config: description: 'Docker daemon JSON configuration' required: false + tcp-port: + description: 'TCP port to expose the Docker API locally' + required: false context: description: 'Docker context name. (default setup-docker-action)' required: false @@ -23,10 +27,16 @@ inputs: description: 'Set DOCKER_HOST environment variable to docker socket path' default: 'false' required: false + rootless: + description: 'Enable Docker rootless mode' + default: 'false' + required: false outputs: sock: description: "Docker socket path" + tcp: + description: "Docker TCP address if tcp-port is set" runs: using: 'node20' diff --git a/docker-bake.hcl b/docker-bake.hcl index 2942972..3d72178 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,3 +1,9 @@ +target "_common" { + args = { + BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1 + } +} + group "default" { targets = ["build"] } @@ -11,42 +17,49 @@ group "validate" { } target "build" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "build-update" output = ["."] } target "build-validate" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "build-validate" output = ["type=cacheonly"] } target "format" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "format-update" output = ["."] } target "lint" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "lint" output = ["type=cacheonly"] } target "vendor-update" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "vendor-update" output = ["."] } target "vendor-validate" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "vendor-validate" output = ["type=cacheonly"] } target "test" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "test-coverage" output = ["./coverage"] diff --git a/src/context.ts b/src/context.ts index 34ba9a7..92c7b4a 100644 --- a/src/context.ts +++ b/src/context.ts @@ -1,19 +1,102 @@ import * as core from '@actions/core'; +import {parse} from 'csv-parse/sync'; + +import {InstallSource} from '@docker/actions-toolkit/lib/docker/install'; +import {Util} from '@docker/actions-toolkit/lib/util'; export interface Inputs { - version: string; - channel: string; + source: InstallSource; daemonConfig?: string; + tcpPort?: number; context: string; setHost: boolean; + rootless: boolean; } export function getInputs(): Inputs { + const rawVersion = core.getInput('version') || 'latest'; + const source = parseSource(rawVersion); + const channel = core.getInput('channel'); + if (channel && source.type === 'archive') { + source.channel = channel; + } + return { - version: core.getInput('version') || 'latest', - channel: core.getInput('channel'), + source: source, daemonConfig: core.getInput('daemon-config'), + tcpPort: Util.getInputNumber('tcp-port'), context: core.getInput('context'), - setHost: core.getBooleanInput('set-host') + setHost: core.getBooleanInput('set-host'), + rootless: core.getBooleanInput('rootless') }; } + +function parseSource(input: string): InstallSource { + let [type, version, channel, tag] = ['archive', 'latest', 'stable', 'latest']; + + const fields = parse(input, { + relaxColumnCount: true, + skipEmptyLines: true + })[0]; + for (const field of fields) { + const parts = field + .toString() + .split(/(?<=^[^=]+?)=/) + .map(item => item.trim()); + + switch (parts[0]) { + case 'type': + type = parts[1]; + break; + case 'version': + version = parts[1]; + break; + case 'channel': + channel = parts[1]; + break; + case 'tag': + tag = parts[1]; + break; + default: + if (fields.length === 1) { + version = parts[0]; + break; + } + throw new Error(`Invalid field: ${parts[0]}`); + } + } + + if (!type) { + throw new Error(`Invalid type: ${type}`); + } + if (!channel) { + throw new Error(`Invalid channel: ${channel}`); + } + if (!version) { + throw new Error(`Invalid version: ${version}`); + } + if (!tag) { + throw new Error(`Invalid tag: ${tag}`); + } + + let src: InstallSource; + switch (type) { + case 'archive': + src = { + type: 'archive', + version: version, + channel: channel + }; + break; + case 'image': + src = { + type: 'image', + tag: tag + }; + break; + default: + throw new Error(`Invalid version: ${input}`); + } + + return src; +} diff --git a/src/main.ts b/src/main.ts index f861851..2c5a95e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,6 @@ +import * as crypto from 'crypto'; import os from 'os'; import path from 'path'; -import * as uuid from 'uuid'; import * as core from '@actions/core'; import * as actionsToolkit from '@docker/actions-toolkit'; import {Install} from '@docker/actions-toolkit/lib/docker/install'; @@ -31,21 +31,29 @@ actionsToolkit.run( await validateSubscription(); const input: context.Inputs = context.getInputs(); - const runDir = path.join(os.homedir(), `setup-docker-action-${uuid.v4().slice(0, 8)}`); + const runDir = path.join(os.homedir(), `setup-docker-action-${crypto.randomUUID().slice(0, 8)}`); if (input.context == 'default') { throw new Error(`'default' context cannot be used.`); } + let tcpPort: number | undefined; + let tcpAddress: string | undefined; + if (input.tcpPort) { + tcpPort = input.tcpPort; + tcpAddress = `tcp://127.0.0.1:${tcpPort}`; + } + const install = new Install({ runDir: runDir, - version: input.version, - channel: input.channel || 'stable', + source: input.source, + rootless: input.rootless, contextName: input.context || 'setup-docker-action', - daemonConfig: input.daemonConfig + daemonConfig: input.daemonConfig, + localTCPPort: tcpPort }); let toolDir; - if (!(await Docker.isAvailable()) || input.version) { + if (!(await Docker.isAvailable()) || input.source) { await core.group(`Download docker`, async () => { toolDir = await install.download(); }); @@ -56,6 +64,10 @@ actionsToolkit.run( await core.group(`Setting outputs`, async () => { core.info(`sock=${sockPath}`); core.setOutput('sock', sockPath); + if (tcpAddress) { + core.info(`tcp=${tcpAddress}`); + core.setOutput('tcp', tcpAddress); + } }); if (input.setHost) {