Skip to content

Commit

Permalink
Don't leave cruft in $PWD when installing
Browse files Browse the repository at this point in the history
  • Loading branch information
shore committed Aug 23, 2024
1 parent cb2384d commit df40d5b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,28 @@ jobs:
run_quiet apt install --yes gh
gh --version
# Create a marker we can use later to verify no files were added to the working directory.
# Extra files make goreleaser anxious.
- name: Create Marker File
run: touch "${RUNNER_TEMP}/pre-install-marker"

- name: Install bob
uses: ./
id: install
with:
tag: ${{ matrix.tag }}
github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}

# Find anything in the working directory newer than the marker created above
- name: Check For New Files
run: |
if [ "$(find "$PWD" -newer "${RUNNER_TEMP}/pre-install-marker" | wc -l | xargs)" -gt 0 ]; then
echo "::error::Unexpected files left in working directory"
find "$PWD" -newer "${RUNNER_TEMP}/pre-install-marker"
exit 1
fi
echo "No unexpected files found."
- name: Test reported version
env:
GH_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
Expand Down
3 changes: 1 addition & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ runs:
id: capture
shell: bash
run: |
bob -version | tee .version_check
echo "installed_version=$(< .version_check)" >> "$GITHUB_OUTPUT"
echo "installed_version=$(bob -version)" | tee -a "$GITHUB_OUTPUT"

0 comments on commit df40d5b

Please sign in to comment.