Skip to content

Commit f977801

Browse files
build: Package action as dist with latest changes
1 parent b2bea73 commit f977801

File tree

9 files changed

+57
-31
lines changed

9 files changed

+57
-31
lines changed

.github/workflows/build_action.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ jobs:
66
build-action:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
10-
- uses: actions/setup-node@v3
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-node@v4
1111
with:
1212
node-version: 16
1313
- run: npm install
@@ -16,7 +16,7 @@ jobs:
1616
run: npm run build
1717
- name: Push build into cache
1818
if: "!startsWith(github.ref, 'refs/heads/release')"
19-
uses: actions/cache@v3
19+
uses: actions/cache@v4
2020
with:
2121
path: dist
2222
key: build-${{ github.sha }}

.github/workflows/directory.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
- action
1212
name: Extract Contents of Directory from Example Image
1313
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-node@v3
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
1616
with:
1717
node-version: 20
1818
- name: Load action build from cache
19-
uses: actions/cache@v3
19+
uses: actions/cache@v4
2020
with:
2121
path: dist
2222
key: build-${{ github.sha }}
@@ -38,12 +38,12 @@ jobs:
3838
- action
3939
name: Extract Nested Directory from Example Image
4040
steps:
41-
- uses: actions/checkout@v2
42-
- uses: actions/setup-node@v3
41+
- uses: actions/checkout@v4
42+
- uses: actions/setup-node@v4
4343
with:
4444
node-version: 20
4545
- name: Load action build from cache
46-
uses: actions/cache@v3
46+
uses: actions/cache@v4
4747
with:
4848
path: dist
4949
key: build-${{ github.sha }}
@@ -61,12 +61,12 @@ jobs:
6161
- action
6262
name: Extract Nested Contents of Directory from Example Image
6363
steps:
64-
- uses: actions/checkout@v2
65-
- uses: actions/setup-node@v3
64+
- uses: actions/checkout@v4
65+
- uses: actions/setup-node@v4
6666
with:
6767
node-version: 20
6868
- name: Load action build from cache
69-
uses: actions/cache@v3
69+
uses: actions/cache@v4
7070
with:
7171
path: dist
7272
key: build-${{ github.sha }}

.github/workflows/file.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
- action
1212
name: Extract Example File From Root of Built Image
1313
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-node@v3
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
1616
with:
1717
node-version: 20
1818
- name: Load action build from cache
19-
uses: actions/cache@v3
19+
uses: actions/cache@v4
2020
with:
2121
path: dist
2222
key: build-${{ github.sha }}
@@ -33,12 +33,12 @@ jobs:
3333
- action
3434
name: Extract Nexted Example File From Built Image
3535
steps:
36-
- uses: actions/checkout@v2
37-
- uses: actions/setup-node@v3
36+
- uses: actions/checkout@v4
37+
- uses: actions/setup-node@v4
3838
with:
3939
node-version: 20
4040
- name: Load action build from cache
41-
uses: actions/cache@v3
41+
uses: actions/cache@v4
4242
with:
4343
path: dist
4444
key: build-${{ github.sha }}

.github/workflows/package-action.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
package-changes:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1717
with:
1818
ref: "${{ env.release }}"
1919
fetch-depth: 0
2020
ssh-key: "${{ secrets.COMMIT_KEY }}"
21-
- uses: actions/setup-node@v3
21+
- uses: actions/setup-node@v4
2222
with:
2323
node-version: 16
2424
- uses: prompt/actions-merge-branch@v2

.github/workflows/platforms.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
- action
1212
name: Extract Example File on Ubuntu
1313
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-node@v3
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
1616
with:
1717
node-version: 20
1818
- name: Load action build from cache
19-
uses: actions/cache@v3
19+
uses: actions/cache@v4
2020
with:
2121
path: dist
2222
key: build-${{ github.sha }}
@@ -28,20 +28,21 @@ jobs:
2828
path: /files/001.txt
2929
- run: test -e ${{ steps.extract.outputs.destination }}/001.txt || exit 1
3030
macos:
31-
runs-on: macos-latest
31+
runs-on: macos-13
32+
if: false # Temporarily disabled due to issues with Docker in macos GitHub Runners
3233
needs:
3334
- action
3435
name: Extract Example File on macOS
3536
steps:
36-
- uses: actions/checkout@v2
37-
- uses: actions/setup-node@v3
37+
- uses: actions/checkout@v4
38+
- uses: actions/setup-node@v4
3839
with:
3940
node-version: 20
4041
- name: Install Docker
4142
uses: douglascamata/setup-docker-macos-action@main
4243
- run: docker build -t example:${{ github.sha }} ./.github/tests
4344
- name: Load action build from cache
44-
uses: actions/cache@v3
45+
uses: actions/cache@v4
4546
with:
4647
path: dist
4748
key: build-${{ github.sha }}

.github/workflows/validate-tag.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
validate-tag:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v4
1313
with:
1414
ssh-key: "${{ secrets.COMMIT_KEY }}"
1515
- name: Test that the tagged commit includes `dist`

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ A GitHub Action for extracting files from a Docker Image.
99
path: "/var/lib/ghost/current/core/built/assets/."
1010
```
1111
12+
:warning: Due to a breaking change in v3 of GitHub's actions/upload-artifact, a
13+
low-impact breaking change has been made to v3.0.1 of this action. Please
14+
see [issues#28](https://github.com/shrink/actions-docker-extract/issues/28) for
15+
context and support.
16+
1217
## Inputs
1318
1419
| ID | Description | Required | Examples |
@@ -25,7 +30,7 @@ A GitHub Action for extracting files from a Docker Image.
2530

2631
| ID | Description | Example |
2732
| ------------- | ------------------------------------------------- | ------------------------ |
28-
| `destination` | Destination path containing the extracted file(s) | `.extracted-1598717412/` |
33+
| `destination` | Destination path containing the extracted file(s) | `extracted-1598717412/` |
2934

3035
## Examples
3136

dist/index.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,17 @@ async function run() {
10911091
try {
10921092
const image = core.getInput('image');
10931093
const path = core.getInput('path');
1094-
const destination = core.getInput('destination') || `.extracted-${Date.now()}`;
1094+
const destination = core.getInput('destination') || `extracted-${Date.now()}`;
1095+
1096+
if (!core.getInput('destination')) {
1097+
core.notice([
1098+
'As you did not specify a docker extract destination, the default is being used.',
1099+
'As of shrink/[email protected] the default does not include a dot prefix.',
1100+
`v3.0.0: ".${destination}", v3.0.1: "${destination}"`,
1101+
'See https://github.com/shrink/actions-docker-extract/issues/28 for context.',
1102+
'No action is required unless this Workflow depends upon the dot prefix.',
1103+
].join(' '));
1104+
}
10951105

10961106
const create = `docker cp $(docker create ${image}):/${path} ${destination}`;
10971107

src/extract.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@ async function run() {
55
try {
66
const image = core.getInput('image');
77
const path = core.getInput('path');
8-
const destination = core.getInput('destination') || `.extracted-${Date.now()}`;
8+
const destination = core.getInput('destination') || `extracted-${Date.now()}`;
9+
10+
if (!core.getInput('destination')) {
11+
core.notice([
12+
'As you did not specify a docker extract destination, the default is being used.',
13+
'As of shrink/[email protected] the default does not include a dot prefix.',
14+
`v3.0.0: ".${destination}", v3.0.1: "${destination}"`,
15+
'See https://github.com/shrink/actions-docker-extract/issues/28 for context.',
16+
'No action is required unless this Workflow depends upon the dot prefix.',
17+
].join(' '));
18+
}
919

1020
const create = `docker cp $(docker create ${image}):/${path} ${destination}`;
1121

0 commit comments

Comments
 (0)