Skip to content

Commit 9e298a5

Browse files
Refactor CI workflow to reset poetry changes and improve clean working tree checks
1 parent 360106b commit 9e298a5

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,24 @@ jobs:
7474
7575
poetry remove cohere
7676
poetry add ../../../cohere-python
77+
cd ../langchain-cohere/libs/cohere
7778
7879
echo "Current cohere installation: $(poetry show cohere)"
7980
make test
8081
make integration_test
8182
echo "tests passed"
8283
83-
# Only fail if there are changes other than poetry.lock and pyproject.toml
84-
CHANGED=$(git status --porcelain | grep -vE 'poetry.lock|pyproject.toml')
85-
if [ -z "$CHANGED" ]; then
86-
echo "No relevant changes detected."
87-
exit 0
88-
else
89-
echo "Unexpected changes detected:"
90-
echo "$CHANGED"
91-
exit 1
92-
fi
84+
# reset poetry changes
85+
git checkout -- poetry.lock pyproject.toml
86+
87+
set -eu
88+
89+
STATUS="$(git status)"
90+
echo "$STATUS"
91+
92+
# grep will exit non-zero if the target message isn't found,
93+
# and `set -e` above will cause the step to fail.
94+
echo "$STATUS" | grep 'nothing to commit, working tree clean'
9395
env:
9496
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
9597

0 commit comments

Comments
 (0)