Skip to content

Commit

Permalink
sock output to get docker socket path
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Feb 29, 2024
1 parent fc6fa62 commit 8e060aa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
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
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 8e060aa

Please sign in to comment.