From a31104c5bf3f12d69299e5e76e9f5295056830d8 Mon Sep 17 00:00:00 2001 From: sam Date: Sat, 7 Sep 2024 03:20:53 +0700 Subject: [PATCH] fix: Remove period (`.`) from destination path (#29) 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. --- .github/workflows/build_action.yaml | 6 +++--- .github/workflows/directory.yml | 18 +++++++++--------- .github/workflows/file.yml | 12 ++++++------ .github/workflows/package-action.yaml | 4 ++-- .github/workflows/platforms.yml | 15 ++++++++------- .github/workflows/validate-tag.yaml | 2 +- README.md | 7 ++++++- src/extract.js | 12 +++++++++++- 8 files changed, 46 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build_action.yaml b/.github/workflows/build_action.yaml index 01a2155..e9e44f9 100644 --- a/.github/workflows/build_action.yaml +++ b/.github/workflows/build_action.yaml @@ -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 @@ -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 }} diff --git a/.github/workflows/directory.yml b/.github/workflows/directory.yml index 14a139a..6172be0 100644 --- a/.github/workflows/directory.yml +++ b/.github/workflows/directory.yml @@ -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 }} @@ -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 }} @@ -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 }} diff --git a/.github/workflows/file.yml b/.github/workflows/file.yml index 4ea4777..acb7f60 100644 --- a/.github/workflows/file.yml +++ b/.github/workflows/file.yml @@ -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 }} @@ -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 }} diff --git a/.github/workflows/package-action.yaml b/.github/workflows/package-action.yaml index 1a4b7f0..6e8d518 100644 --- a/.github/workflows/package-action.yaml +++ b/.github/workflows/package-action.yaml @@ -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 diff --git a/.github/workflows/platforms.yml b/.github/workflows/platforms.yml index 2b4a3e7..7c1d2f0 100644 --- a/.github/workflows/platforms.yml +++ b/.github/workflows/platforms.yml @@ -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 }} @@ -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 }} diff --git a/.github/workflows/validate-tag.yaml b/.github/workflows/validate-tag.yaml index 29266ac..0d056c6 100644 --- a/.github/workflows/validate-tag.yaml +++ b/.github/workflows/validate-tag.yaml @@ -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` diff --git a/README.md b/README.md index 933deee..2aebd04 100644 --- a/README.md +++ b/README.md @@ -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 | @@ -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 diff --git a/src/extract.js b/src/extract.js index 9c0e32d..dbac43a 100644 --- a/src/extract.js +++ b/src/extract.js @@ -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/actions-docker-extract@v3.0.1 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}`;