File tree Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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
1114outputs :
1215 destination :
1316 description : ' Destination of extracted file(s)'
Original file line number Diff line number Diff 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 } ` ) ;
Original file line number Diff line number Diff 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 } ` ) ;
You can’t perform that action at this time.
0 commit comments