From 7abc80a9c40e40b24bfbb78d99c41d4072b11575 Mon Sep 17 00:00:00 2001 From: Fabian Aguilar Gomez Date: Fri, 6 Sep 2024 15:26:51 -0500 Subject: [PATCH 1/9] ignore all hidden files when creating zip --- action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/action.yml b/action.yml index a19976e..b297eea 100644 --- a/action.yml +++ b/action.yml @@ -32,6 +32,7 @@ runs: -cvf "$RUNNER_TEMP/artifact.tar" \ --exclude=.git \ --exclude=.github \ + --exclude=".*" \ . echo ::endgroup:: env: @@ -49,6 +50,7 @@ runs: -cvf "$RUNNER_TEMP/artifact.tar" \ --exclude=.git \ --exclude=.github \ + --exclude=".*" \ . echo ::endgroup:: env: @@ -66,6 +68,7 @@ runs: -cvf "$RUNNER_TEMP\artifact.tar" \ --exclude=.git \ --exclude=.github \ + --exclude=".*" \ --force-local \ "." echo ::endgroup:: From aefddd41c8ac0f407b4ee9a1c69e66d965a7f461 Mon Sep 17 00:00:00 2001 From: Fabian Aguilar Gomez Date: Fri, 6 Sep 2024 15:40:26 -0500 Subject: [PATCH 2/9] Updates from editor --- action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index b297eea..f2c7662 100644 --- a/action.yml +++ b/action.yml @@ -32,7 +32,7 @@ runs: -cvf "$RUNNER_TEMP/artifact.tar" \ --exclude=.git \ --exclude=.github \ - --exclude=".*" \ + --exclude=".[^/]*" \ . echo ::endgroup:: env: @@ -50,7 +50,7 @@ runs: -cvf "$RUNNER_TEMP/artifact.tar" \ --exclude=.git \ --exclude=.github \ - --exclude=".*" \ + --exclude=".[^/]*" \ . echo ::endgroup:: env: @@ -68,7 +68,7 @@ runs: -cvf "$RUNNER_TEMP\artifact.tar" \ --exclude=.git \ --exclude=.github \ - --exclude=".*" \ + --exclude=".[^/]*" \ --force-local \ "." echo ::endgroup:: From b73e0a2c88aa4f6eb42e40c04c8b8ca2765c70ee Mon Sep 17 00:00:00 2001 From: Fabian Aguilar Gomez Date: Fri, 6 Sep 2024 15:49:08 -0500 Subject: [PATCH 3/9] Update test-hosted-runners.yml --- .github/workflows/test-hosted-runners.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-hosted-runners.yml b/.github/workflows/test-hosted-runners.yml index 0371537..a85499f 100644 --- a/.github/workflows/test-hosted-runners.yml +++ b/.github/workflows/test-hosted-runners.yml @@ -51,3 +51,7 @@ 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 + + - 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 From a5aa90da219b6301518f90b7a7d29964afb83308 Mon Sep 17 00:00:00 2001 From: Fabian Aguilar Gomez Date: Mon, 9 Sep 2024 15:01:26 -0500 Subject: [PATCH 4/9] add hidden files --- script/new-artifact.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/new-artifact.sh b/script/new-artifact.sh index 136e632..f93af6b 100755 --- a/script/new-artifact.sh +++ b/script/new-artifact.sh @@ -8,3 +8,7 @@ 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 +echo 'bar' > subdir/.hidden_also From a16f4a08dd86a36ff02f9b004af8ebbc790b8047 Mon Sep 17 00:00:00 2001 From: Fabian Aguilar Gomez Date: Mon, 9 Sep 2024 15:23:36 -0500 Subject: [PATCH 5/9] Update test-hosted-runners.yml --- .github/workflows/test-hosted-runners.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-hosted-runners.yml b/.github/workflows/test-hosted-runners.yml index a85499f..246d170 100644 --- a/.github/workflows/test-hosted-runners.yml +++ b/.github/workflows/test-hosted-runners.yml @@ -45,7 +45,13 @@ jobs: shell: bash - name: Compare files - run: diff -qr artifact artifact2 + run: | + diff_output=$(diff -qr artifact artifact2 | grep -v -e '.hidden' -e 'subdir/.hidden_also') + if [ -n "$diff_output" ]; then + echo "Unexpected differences found:" + echo "$diff_output" + exit 1 + fi shell: bash - name: Check for absence of symlinks From b83d5a118e1ad9ae2689ef1ee7d3a162accab119 Mon Sep 17 00:00:00 2001 From: Fabian Aguilar Gomez Date: Mon, 9 Sep 2024 15:27:19 -0500 Subject: [PATCH 6/9] Updates from editor --- .github/workflows/test-hosted-runners.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-hosted-runners.yml b/.github/workflows/test-hosted-runners.yml index 246d170..94866e8 100644 --- a/.github/workflows/test-hosted-runners.yml +++ b/.github/workflows/test-hosted-runners.yml @@ -46,7 +46,7 @@ jobs: - name: Compare files run: | - diff_output=$(diff -qr artifact artifact2 | grep -v -e '.hidden' -e 'subdir/.hidden_also') + diff_output=$(diff -qr artifact artifact2 | grep -v -e '.hidden') if [ -n "$diff_output" ]; then echo "Unexpected differences found:" echo "$diff_output" From 2219f71d09e30813c5c81c7ba9616f0e63b6136e Mon Sep 17 00:00:00 2001 From: Fabian Aguilar Gomez Date: Mon, 9 Sep 2024 15:28:03 -0500 Subject: [PATCH 7/9] Updates from editor --- script/new-artifact.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/script/new-artifact.sh b/script/new-artifact.sh index f93af6b..102d41a 100755 --- a/script/new-artifact.sh +++ b/script/new-artifact.sh @@ -11,4 +11,3 @@ ln -s hello.txt bonjour.txt # Create some hidden files echo 'foo' > .hidden -echo 'bar' > subdir/.hidden_also From 5ed71eacfa0a19ed287e2712edadebff450ba1d8 Mon Sep 17 00:00:00 2001 From: Fabian Aguilar Gomez Date: Mon, 9 Sep 2024 15:30:05 -0500 Subject: [PATCH 8/9] Updates from editor --- .github/workflows/test-hosted-runners.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/test-hosted-runners.yml b/.github/workflows/test-hosted-runners.yml index 94866e8..a85499f 100644 --- a/.github/workflows/test-hosted-runners.yml +++ b/.github/workflows/test-hosted-runners.yml @@ -45,13 +45,7 @@ jobs: shell: bash - name: Compare files - run: | - diff_output=$(diff -qr artifact artifact2 | grep -v -e '.hidden') - if [ -n "$diff_output" ]; then - echo "Unexpected differences found:" - echo "$diff_output" - exit 1 - fi + run: diff -qr artifact artifact2 shell: bash - name: Check for absence of symlinks From 717c17dd70f0c53add0dfc7f012eedd7fd142370 Mon Sep 17 00:00:00 2001 From: Fabian Aguilar Gomez Date: Mon, 9 Sep 2024 15:34:39 -0500 Subject: [PATCH 9/9] Updates from editor --- .github/workflows/test-hosted-runners.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-hosted-runners.yml b/.github/workflows/test-hosted-runners.yml index a85499f..0d31739 100644 --- a/.github/workflows/test-hosted-runners.yml +++ b/.github/workflows/test-hosted-runners.yml @@ -44,14 +44,16 @@ 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 run: if [ $(find artifact2 -type l | wc -l) != 0 ]; then echo "Symlinks found"; exit 1; fi 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