Skip to content

Commit e3f94b3

Browse files
build: Package action as dist with latest changes
1 parent 22c00ba commit e3f94b3

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ A GitHub Action for extracting files from a Docker Image.
1111
1212
## Inputs
1313
14-
All inputs are required.
15-
16-
| ID | Description | Examples |
17-
| ------- | ---------------------------------------------------- | --------------------------------------------- |
18-
| `image` | Docker Image to extract files from | `alpine` `ghcr.io/github/super-linter:latest` |
19-
| `path` | Path (from root) to a file or directory within Image | `files/example.txt` `files` `files/.` |
14+
| ID | Description | Required | Examples |
15+
| ------------- | ---------------------------------------------------- | :------: | --------------------------------------------- |
16+
| `image` | Docker Image to extract files from | ✅ | `alpine` `ghcr.io/github/super-linter:latest` |
17+
| `path` | Path (from root) to a file or directory within Image | ✅ | `files/example.txt` `files` `files/.` |
18+
| `destination` | Destination path for the extracted files | ❌ | `/foo/` `~/` `./foo/bar` |
2019

2120
> :paperclip: To copy the **contents** of a directory the `path` must end with
2221
> `/.` otherwise the directory itself will be copied. More information about the

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ inputs:
88
path:
99
description: 'Path (from root) to a file or directory within Image'
1010
required: true
11+
destination:
12+
description: 'Destination path for the extracted files'
13+
required: false
1114
outputs:
1215
destination:
1316
description: 'Destination of extracted file(s)'

dist/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,8 @@ async function run() {
10911091
try {
10921092
const image = core.getInput('image');
10931093
const path = core.getInput('path');
1094-
const destination = `.extracted-${Date.now()}`;
1094+
const destination = core.getInput('destination') || `.extracted-${Date.now()}`;
1095+
10951096
const create = `docker cp $(docker create ${image}):/${path} ${destination}`;
10961097

10971098
await exec.exec(`mkdir -p ${destination}`);

src/extract.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ async function run() {
55
try {
66
const image = core.getInput('image');
77
const path = core.getInput('path');
8-
const destination = `.extracted-${Date.now()}`;
8+
const destination = core.getInput('destination') || `.extracted-${Date.now()}`;
9+
910
const create = `docker cp $(docker create ${image}):/${path} ${destination}`;
1011

1112
await exec.exec(`mkdir -p ${destination}`);

0 commit comments

Comments
 (0)