Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/test-hosted-runners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,46 @@ jobs:
- name: Check for absence of symlinks
run: if [ $(find artifact2 -type l | wc -l) != 0 ]; then echo "Symlinks found"; exit 1; fi
shell: bash

test-include-hidden:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Generate files
run: mkdir artifact && mkdir artifact2 && cd artifact && ../script/new-artifact.sh
shell: bash

- name: Upload Pages artifact
uses: ./
with:
name: pages-artifact-hidden-${{ matrix.os }}
path: artifact
include-hidden-files: true

- name: Download artifact
uses: actions/download-artifact@v4
with:
name: pages-artifact-hidden-${{ matrix.os }}
path: artifact2

- name: Extract artifact
run: tar -xf artifact2/artifact.tar -C artifact2 && rm artifact2/artifact.tar
shell: bash

- name: Check for presence of hidden files
run: if [ $(find artifact2 -regex ".*/\..*" | wc -l) == 0 ]; then echo "Hidden files not found"; exit 1; fi
shell: bash

- name: Compare files
run: diff -qr artifact artifact2
shell: bash

- name: Check for absence of symlinks
run: if [ $(find artifact2 -type l | wc -l) != 0 ]; then echo "Symlinks found"; exit 1; fi
shell: bash
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
| `name` | `false` | `github-pages` | Artifact name |
| `path` | `true` | `_site/` | Path of the directory containing the static assets |
| `retention-days` | `false` | `1` | Duration after which artifact will expire in days |
| `include-hidden-files` | `false` | `false` | Include hidden files and directories (those starting with a dot) in the artifact. Excludes `.git` and `.github` regardless. |

### Outputs 📤

Expand Down
10 changes: 7 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ inputs:
description: "Duration after which artifact will expire in days."
required: false
default: "1"
include-hidden-files:
description: "Include hidden files and directories (those starting with a dot) in the artifact. Excludes .git and .github regardless."
required: false
default: "false"
outputs:
artifact_id:
description: "The ID of the artifact that was uploaded."
Expand All @@ -32,7 +36,7 @@ runs:
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
--exclude=".[^/]*" \
${{ inputs.include-hidden-files != 'true' && '--exclude=.[^/]*' || '' }} \
.
echo ::endgroup::
env:
Expand All @@ -50,7 +54,7 @@ runs:
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
--exclude=".[^/]*" \
${{ inputs.include-hidden-files != 'true' && '--exclude=.[^/]*' || '' }} \
.
echo ::endgroup::
env:
Expand All @@ -68,7 +72,7 @@ runs:
-cvf "$RUNNER_TEMP\artifact.tar" \
--exclude=.git \
--exclude=.github \
--exclude=".[^/]*" \
${{ inputs.include-hidden-files != 'true' && '--exclude=.[^/]*' || '' }} \
--force-local \
"."
echo ::endgroup::
Expand Down