Skip to content

Commit

Permalink
Verify that the GitHub Action doesn't taint the working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
pietern committed Jun 12, 2024
1 parent 15d291a commit f84daf2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
- run: ./setup-cli/assert/version.sh $(cat ./setup-cli/VERSION)
shell: bash

- run: ./setup-cli/assert/clean.sh
shell: bash

action_with_version:
runs-on: ${{ matrix.os }}

Expand All @@ -60,6 +63,9 @@ jobs:
- run: ./setup-cli/assert/version.sh 0.200.0
shell: bash

- run: ./setup-cli/assert/clean.sh
shell: bash

install:
runs-on: ${{ matrix.os }}

Expand Down
16 changes: 16 additions & 0 deletions assert/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -euo pipefail

function list_files() {
find . -not -path './setup-cli*'
}

# The ./setup-cli path is expected to be present.
if test -n "$(list_files)" ; then
echo "Found unexpected files in working directory:"
list_files
exit 1
else
exit 0
fi

0 comments on commit f84daf2

Please sign in to comment.