Skip to content

Commit efaad07

Browse files
authored
Merge pull request #102 from actions/hidden-files
ignore all hidden files when creating zip
2 parents 2eb9582 + fc056d0 commit efaad07

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

.github/workflows/test-hosted-runners.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,14 @@ jobs:
4444
run: tar -xf artifact2/artifact.tar -C artifact2 && rm artifact2/artifact.tar
4545
shell: bash
4646

47+
- name: Check for absence of hidden files
48+
run: if [ $(find artifact2 -regex ".*/\..*" | wc -l) != 0 ]; then echo "Hidden files found"; exit 1; fi
49+
shell: bash
50+
4751
- name: Compare files
48-
run: diff -qr artifact artifact2
52+
run: |
53+
rm artifact/.hidden
54+
diff -qr artifact artifact2
4955
shell: bash
5056

5157
- name: Check for absence of symlinks

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ runs:
3232
-cvf "$RUNNER_TEMP/artifact.tar" \
3333
--exclude=.git \
3434
--exclude=.github \
35+
--exclude=".[^/]*" \
3536
.
3637
echo ::endgroup::
3738
env:
@@ -49,6 +50,7 @@ runs:
4950
-cvf "$RUNNER_TEMP/artifact.tar" \
5051
--exclude=.git \
5152
--exclude=.github \
53+
--exclude=".[^/]*" \
5254
.
5355
echo ::endgroup::
5456
env:
@@ -66,6 +68,7 @@ runs:
6668
-cvf "$RUNNER_TEMP\artifact.tar" \
6769
--exclude=.git \
6870
--exclude=.github \
71+
--exclude=".[^/]*" \
6972
--force-local \
7073
"."
7174
echo ::endgroup::

script/new-artifact.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ echo 'world' > subdir/world.txt
88
# Add some symlinks (which we should dereference properly when archiving)
99
ln -s subdir subdir-link
1010
ln -s hello.txt bonjour.txt
11+
12+
# Create some hidden files
13+
echo 'foo' > .hidden

0 commit comments

Comments
 (0)