Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
2199191
Add exclude-pattern input to action.yml
scottschreckengaust Dec 16, 2025
9103460
Enhance artifact management in CI workflow
scottschreckengaust Dec 16, 2025
1f0d0fa
Fix directory navigation in Generate files step
scottschreckengaust Dec 16, 2025
80c3620
Fix exclude-pattern default value syntax
scottschreckengaust Dec 16, 2025
d5dd95e
Add 'exclude-pattern' input to README
scottschreckengaust Dec 16, 2025
659fbcd
Update comment for hidden files creation
scottschreckengaust Dec 16, 2025
3490fe6
Remove hidden2 directory in comparison step
scottschreckengaust Dec 16, 2025
440fc47
Update new-artifact.sh
scottschreckengaust Dec 16, 2025
2bfcdea
Add 'append' input option to action.yml
scottschreckengaust Dec 16, 2025
60fbe24
Add 'append' option to artifact configuration
scottschreckengaust Dec 16, 2025
a763f39
Add 'hello' to a new file in the parent directory
scottschreckengaust Dec 16, 2025
c3e6290
Update script to create .well-known directory
scottschreckengaust Dec 16, 2025
e6150f8
Enhance test-hosted-runners workflow with new artifact handling
scottschreckengaust Dec 16, 2025
cb1b9be
Update new-artifact.sh
scottschreckengaust Dec 16, 2025
24455b6
Update inputs section in README.md
scottschreckengaust Dec 16, 2025
2e80a8b
Refactor action.yml to use append-items input
scottschreckengaust Dec 16, 2025
5e3275a
Update workflow for artifact generation and comparison
scottschreckengaust Dec 16, 2025
a1beb61
Fix exclude pattern in action.yml for tar command
scottschreckengaust Dec 16, 2025
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
26 changes: 24 additions & 2 deletions .github/workflows/test-hosted-runners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/checkout@v4

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

- name: Upload Pages artifact
Expand All @@ -50,10 +50,32 @@ jobs:

- name: Compare files
run: |
rm artifact/.hidden
rm -r -f artifact/.hidden*
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

- name: Upload Pages artifact appended
uses: ./
with:
name: pages-artifact-appended-${{ matrix.os }}
path: artifact3
append-items: .hidden .hidden2

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

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

- name: Compare files appended
run: |
diff -qr artifact3 artifact4
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 |
| `append` | `false` | `` | Append files and folders |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `append` | `false` | `` | Append files and folders |
| `append-items` | `false` | `` | Append files and folders |


### Outputs 📤

Expand Down
30 changes: 30 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ inputs:
description: "Duration after which artifact will expire in days."
required: false
default: "1"
append-items:
description: "Append files and directories."
required: false
default: ""

outputs:
artifact_id:
description: "The ID of the artifact that was uploaded."
Expand All @@ -34,9 +39,17 @@ runs:
--exclude=.github \
--exclude=".[^/]*" \
.
if [ -n "$APPEND_ITEMS" ]; then
tar \
--dereference --hard-dereference \
--directory "$INPUT_PATH" \
-rvf "$RUNNER_TEMP/artifact.tar" \
$APPEND_ITEMS
fi
echo ::endgroup::
env:
INPUT_PATH: ${{ inputs.path }}
APPEND_ITEMS: ${{ inputs.append-items }}

# Switch to gtar (GNU tar instead of bsdtar which is the default in the MacOS runners so we can use --hard-dereference)
- name: Archive artifact
Expand All @@ -52,9 +65,17 @@ runs:
--exclude=.github \
--exclude=".[^/]*" \
.
if [ -n "$APPEND_ITEMS" ]; then
gtar \
--dereference --hard-dereference \
--directory "$INPUT_PATH" \
-rvf "$RUNNER_TEMP/artifact.tar" \
$APPEND_ITEMS
fi
echo ::endgroup::
env:
INPUT_PATH: ${{ inputs.path }}
APPEND_ITEMS: ${{ inputs.append-items }}

# Massage the paths for Windows only
- name: Archive artifact
Expand All @@ -71,9 +92,18 @@ runs:
--exclude=".[^/]*" \
--force-local \
"."
if [ -n "$APPEND_ITEMS" ]; then
tar \
--dereference --hard-dereference \
--directory "$INPUT_PATH" \
-rvf "$RUNNER_TEMP\artifact.tar" \
--force-local \
$APPEND_ITEMS
fi
echo ::endgroup::
env:
INPUT_PATH: ${{ inputs.path }}
APPEND_ITEMS: ${{ inputs.append-items }}

- name: Upload artifact
id: upload-artifact
Expand Down
3 changes: 2 additions & 1 deletion script/new-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ echo 'world' > subdir/world.txt
ln -s subdir subdir-link
ln -s hello.txt bonjour.txt

# Create some hidden files
# Create some hidden files or folders
echo 'foo' > .hidden
mkdir -p .hidden2 && echo 'bar' > .hidden2/bar