Skip to content

Commit

Permalink
Merge pull request #102 from actions/hidden-files
Browse files Browse the repository at this point in the history
ignore all hidden files when creating zip
  • Loading branch information
tsusdere authored Sep 11, 2024
2 parents 2eb9582 + fc056d0 commit efaad07
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/test-hosted-runners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,14 @@ jobs:
run: tar -xf artifact2/artifact.tar -C artifact2 && rm artifact2/artifact.tar
shell: bash

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

- name: Compare files
run: diff -qr artifact artifact2
run: |
rm artifact/.hidden
diff -qr artifact artifact2
shell: bash

- name: Check for absence of symlinks
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ runs:
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
--exclude=".[^/]*" \
.
echo ::endgroup::
env:
Expand All @@ -49,6 +50,7 @@ runs:
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
--exclude=".[^/]*" \
.
echo ::endgroup::
env:
Expand All @@ -66,6 +68,7 @@ runs:
-cvf "$RUNNER_TEMP\artifact.tar" \
--exclude=.git \
--exclude=.github \
--exclude=".[^/]*" \
--force-local \
"."
echo ::endgroup::
Expand Down
3 changes: 3 additions & 0 deletions script/new-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ echo 'world' > subdir/world.txt
# Add some symlinks (which we should dereference properly when archiving)
ln -s subdir subdir-link
ln -s hello.txt bonjour.txt

# Create some hidden files
echo 'foo' > .hidden

0 comments on commit efaad07

Please sign in to comment.