Skip to content

Commit

Permalink
build: Package action as dist with latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 6, 2024
1 parent b2bea73 commit f977801
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 31 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 dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,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
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 f977801

Please sign in to comment.