Skip to content

Commit

Permalink
ci: Update restore-node dirty check to ignore untracked endo-sha.txt
Browse files Browse the repository at this point in the history
Fixes #9708
  • Loading branch information
gibson042 committed Jul 13, 2024
1 parent 013a84c commit bd6d6dc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/actions/restore-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ runs:
echo "sha=$sha" >> $GITHUB_OUTPUT
cd "${{ inputs.path }}"
echo "$sha" > endo-sha.txt
git add endo-sha.txt
- name: Reconfigure git to use HTTP authentication
shell: bash
Expand Down Expand Up @@ -187,9 +186,12 @@ runs:
shell: bash
run: |-
set -x
# In case of Endo override, ignore matching index and worktree.
# (First column is non-space, second column is space, followed by separator.)
if [ -n "$(git status --porcelain | grep -Eve '^[^ ] '; true)" ]; then
# Fail if `git status` reports anything other than the following:
# * an untracked endo-sha.txt from above
# * work tree files that have been staged without further changes
# (e.g., package.json or yarn.lock) as indicated by the Y position
# in "XY PATH" being a space
if git status --porcelain | awk '$0 !~ /^[?][?] endo-sha.txt$|^. |^$/ { exit 1; }'; then
git status
echo "Unexpected dirty git status" 1>&2
exit 1
Expand Down

0 comments on commit bd6d6dc

Please sign in to comment.