Merge pull request #102 from actions/hidden-files

ignore all hidden files when creating zip
This commit is contained in:
Fabian Aguilar Gomez
2024-09-11 13:09:57 -05:00
committed by GitHub
3 changed files with 13 additions and 1 deletions

View File

@@ -44,8 +44,14 @@ jobs:
run: tar -xf artifact2/artifact.tar -C artifact2 && rm artifact2/artifact.tar run: tar -xf artifact2/artifact.tar -C artifact2 && rm artifact2/artifact.tar
shell: bash 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 - name: Compare files
run: diff -qr artifact artifact2 run: |
rm artifact/.hidden
diff -qr artifact artifact2
shell: bash shell: bash
- name: Check for absence of symlinks - name: Check for absence of symlinks

View File

@@ -32,6 +32,7 @@ runs:
-cvf "$RUNNER_TEMP/artifact.tar" \ -cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \ --exclude=.git \
--exclude=.github \ --exclude=.github \
--exclude=".[^/]*" \
. .
echo ::endgroup:: echo ::endgroup::
env: env:
@@ -49,6 +50,7 @@ runs:
-cvf "$RUNNER_TEMP/artifact.tar" \ -cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \ --exclude=.git \
--exclude=.github \ --exclude=.github \
--exclude=".[^/]*" \
. .
echo ::endgroup:: echo ::endgroup::
env: env:
@@ -66,6 +68,7 @@ runs:
-cvf "$RUNNER_TEMP\artifact.tar" \ -cvf "$RUNNER_TEMP\artifact.tar" \
--exclude=.git \ --exclude=.git \
--exclude=.github \ --exclude=.github \
--exclude=".[^/]*" \
--force-local \ --force-local \
"." "."
echo ::endgroup:: echo ::endgroup::

View File

@@ -8,3 +8,6 @@ echo 'world' > subdir/world.txt
# Add some symlinks (which we should dereference properly when archiving) # Add some symlinks (which we should dereference properly when archiving)
ln -s subdir subdir-link ln -s subdir subdir-link
ln -s hello.txt bonjour.txt ln -s hello.txt bonjour.txt
# Create some hidden files
echo 'foo' > .hidden