Skip to content

Commit

Permalink
Merge pull request #57 from crazy-max/sock-output
Browse files Browse the repository at this point in the history
sock output to get docker socket path
  • Loading branch information
crazy-max authored Feb 29, 2024
2 parents fc6fa62 + c6f8a8a commit 38c0711
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
pull_request:

env:
DOCKER_VERSION: v23.0.6
DOCKER_VERSION: v24.0.9

jobs:
main:
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
name: Set up Docker
uses: ./
with:
version: v23.0.0-rc.4
version: v24.0.0-rc.4
channel: test
-
name: Dump context
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ___
* [Define custom `limactl start` arguments (macOS)](#define-custom-limactl-start-arguments-macos)
* [Customizing](#customizing)
* [inputs](#inputs)
* [outputs](#outputs)
* [Contributing](#contributing)
* [License](#license)

Expand Down Expand Up @@ -106,6 +107,14 @@ The following inputs can be used as `step.with` keys
| `daemon-config` | String | | [Docker daemon JSON configuration](https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file) |
| `context` | String | `setup-docker-action` | Docker context name. |

### outputs

The following outputs are available

| Name | Type | Description |
|--------|--------|--------------------|
| `sock` | String | Docker socket path |

## Contributing

Want to contribute? Awesome! The most basic way to show your support is to star
Expand Down
8 changes: 4 additions & 4 deletions __tests__/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ describe('getInputs', () => {
[
0,
new Map<string, string>([
['version', 'v23.0.1'],
['version', 'v24.0.8'],
]),
{
version: 'v23.0.1',
version: 'v24.0.8',
channel: '',
context: '',
daemonConfig: '',
Expand All @@ -29,13 +29,13 @@ describe('getInputs', () => {
[
1,
new Map<string, string>([
['version', 'v23.0.0-rc.4'],
['version', 'v24.0.0-rc.4'],
['channel', 'test'],
['context', 'foo'],
['daemon-config', `{"debug":true,"features":{"containerd-snapshotter":true}}`],
]),
{
version: 'v23.0.0-rc.4',
version: 'v24.0.0-rc.4',
channel: 'test',
context: 'foo',
daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`,
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ branding:

inputs:
version:
description: 'Docker CE version. (e.g, v23.0.1)'
description: 'Docker CE version. (e.g, v24.0.9)'
required: false
default: 'latest'
channel:
Expand All @@ -21,6 +21,10 @@ inputs:
description: 'Docker context name. (default setup-docker-action)'
required: false

outputs:
sock:
description: "Docker socket path"

runs:
using: 'node20'
main: 'dist/index.js'
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ actionsToolkit.run(
}
if (toolDir) {
stateHelper.setRunDir(runDir);
await install.install();
const sockPath = await install.install();
await core.group(`Setting outputs`, async () => {
core.info(`sock=${sockPath}`);
core.setOutput('sock', sockPath);
});
}

await core.group(`Docker info`, async () => {
Expand Down

0 comments on commit 38c0711

Please sign in to comment.