Skip to content

Commit

Permalink
Halt if no changes to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
noisekit committed Aug 18, 2023
1 parent b5b51ac commit 76fb434
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ jobs:
command: |
cp ~/synthetix-v3/docs/smart-contracts.md ./for-developers/smart-contracts.md
STATUS=$(git status)
if [[ $STATUS == *"nothing to commit, working tree clean"* ]]; then
echo "SKIP. Working tree is clean. No changes to Smart Contracts docs"
exit 0
fi
git branch smart-contracts
git checkout smart-contracts
Expand All @@ -55,6 +61,12 @@ jobs:
working_directory: ~/synthetix-gitbook-v3
name: "Create Pull Request for smart-contracts branch"
command: |
STATUS=$(git status)
if [[ $STATUS == *"nothing to commit, working tree clean"* ]]; then
echo "SKIP. Working tree is clean. No changes to Smart Contracts docs"
exit 0
fi
PR_URL=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/Synthetixio/Synthetix-Gitbook-v3/pulls?state=open | \
jq -r '.[] | select(.head.ref=="smart-contracts") | .html_url')
Expand Down

0 comments on commit 76fb434

Please sign in to comment.