Skip to content

Commit

Permalink
ci: ignore yarn.lock when the branch is valid (#9849)
Browse files Browse the repository at this point in the history
closes #9850
  • Loading branch information
mergify[bot] authored Aug 7, 2024
2 parents 1dd604b + f593d1f commit fc104e8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/actions/restore-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,9 @@ runs:
uses: pyTooling/Actions/with-post-step@v0.4.5
with:
main: |
bash "$SRC/.github/actions/restore-node/check-git-status.sh" "$SRC"
bash "$SRC/.github/actions/restore-node/check-git-status.sh" "$SRC" "$IGNORE_DIRTY_YARN_LOCK"
post: |
bash "$SRC/.github/actions/restore-node/check-git-status.sh" "$SRC"
bash "$SRC/.github/actions/restore-node/check-git-status.sh" "$SRC" "$IGNORE_DIRTY_YARN_LOCK"
env:
SRC: ${{ inputs.path }}
IGNORE_DIRTY_YARN_LOCK: ${{ steps.endo-branch.outputs.result != 'NOPE' }}
15 changes: 15 additions & 0 deletions .github/actions/restore-node/check-git-status.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
#!/bin/bash

# Set verbose execution
set -x

# Navigate to the specified directory
cd "$1" || exit $?

# Get the value of IGNORE_ENDO_BRANCH
ignore_dirty_yarn_lock=$2 || exit $?

# Check for unexpected changes
# Fail if git status detects changes
changes=$(git status --porcelain)

if [ "$ignore_dirty_yarn_lock" = true ]; then
# When integration is requested with a specific Endo branch, ignore changes:
# - package.json has a modified `"resolutions":` field,
# - yarn.lock is changed because of those resolutions.
# For more details, refer to https://github.com/Agoric/agoric-sdk/issues/9850.
changes=$(echo "$changes" | grep -v " yarn.lock")
fi

if [ -n "$changes" ]; then
git status
echo "Unexpected dirty git status in Agoric SDK path"
Expand Down

0 comments on commit fc104e8

Please sign in to comment.