Skip to content

Commit

Permalink
fix: Remove period (.) from destination path (#29)
Browse files Browse the repository at this point in the history
GitHub's `actions/artifact-upload` ignores dotfiles by default now (a breaking change) so this Action will not work as expected for users impacted by that change. The change here is technically breaking (as the default destination will no longer start with a `.`) but because the destination name is randomly generated, it should not impact any integrations.
  • Loading branch information
shrink committed Sep 6, 2024
1 parent 15c8bf3 commit a31104c
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 30 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build_action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
build-action:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- run: npm install
Expand All @@ -16,7 +16,7 @@ jobs:
run: npm run build
- name: Push build into cache
if: "!startsWith(github.ref, 'refs/heads/release')"
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: dist
key: build-${{ github.sha }}
18 changes: 9 additions & 9 deletions .github/workflows/directory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
- action
name: Extract Contents of Directory from Example Image
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Load action build from cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: dist
key: build-${{ github.sha }}
Expand All @@ -38,12 +38,12 @@ jobs:
- action
name: Extract Nested Directory from Example Image
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Load action build from cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: dist
key: build-${{ github.sha }}
Expand All @@ -61,12 +61,12 @@ jobs:
- action
name: Extract Nested Contents of Directory from Example Image
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Load action build from cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: dist
key: build-${{ github.sha }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
- action
name: Extract Example File From Root of Built Image
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Load action build from cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: dist
key: build-${{ github.sha }}
Expand All @@ -33,12 +33,12 @@ jobs:
- action
name: Extract Nexted Example File From Built Image
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Load action build from cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: dist
key: build-${{ github.sha }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/package-action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
package-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: "${{ env.release }}"
fetch-depth: 0
ssh-key: "${{ secrets.COMMIT_KEY }}"
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
- uses: prompt/actions-merge-branch@v2
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
- action
name: Extract Example File on Ubuntu
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Load action build from cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: dist
key: build-${{ github.sha }}
Expand All @@ -28,20 +28,21 @@ jobs:
path: /files/001.txt
- run: test -e ${{ steps.extract.outputs.destination }}/001.txt || exit 1
macos:
runs-on: macos-latest
runs-on: macos-13
if: false # Temporarily disabled due to issues with Docker in macos GitHub Runners
needs:
- action
name: Extract Example File on macOS
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Docker
uses: douglascamata/setup-docker-macos-action@main
- run: docker build -t example:${{ github.sha }} ./.github/tests
- name: Load action build from cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: dist
key: build-${{ github.sha }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
validate-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ssh-key: "${{ secrets.COMMIT_KEY }}"
- name: Test that the tagged commit includes `dist`
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ A GitHub Action for extracting files from a Docker Image.
path: "/var/lib/ghost/current/core/built/assets/."
```
:warning: Due to a breaking change in v3 of GitHub's actions/upload-artifact, a
low-impact breaking change has been made to v3.0.1 of this action. Please
see [issues#28](https://github.com/shrink/actions-docker-extract/issues/28) for
context and support.
## Inputs
| ID | Description | Required | Examples |
Expand All @@ -25,7 +30,7 @@ A GitHub Action for extracting files from a Docker Image.

| ID | Description | Example |
| ------------- | ------------------------------------------------- | ------------------------ |
| `destination` | Destination path containing the extracted file(s) | `.extracted-1598717412/` |
| `destination` | Destination path containing the extracted file(s) | `extracted-1598717412/` |

## Examples

Expand Down
12 changes: 11 additions & 1 deletion src/extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ async function run() {
try {
const image = core.getInput('image');
const path = core.getInput('path');
const destination = core.getInput('destination') || `.extracted-${Date.now()}`;
const destination = core.getInput('destination') || `extracted-${Date.now()}`;

if (!core.getInput('destination')) {
core.notice([
'As you did not specify a docker extract destination, the default is being used.',
'As of shrink/[email protected] the default does not include a dot prefix.',
`v3.0.0: ".${destination}", v3.0.1: "${destination}"`,
'See https://github.com/shrink/actions-docker-extract/issues/28 for context.',
'No action is required unless this Workflow depends upon the dot prefix.',
].join(' '));
}

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

Expand Down

0 comments on commit a31104c

Please sign in to comment.