Skip to content

Commit

Permalink
Handle empty patches, refs #1
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw authored Aug 20, 2023
1 parent 8d08021 commit ef6e723
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/stable-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ jobs:
git fetch origin stable-docs:stable-docs
git checkout stable-docs
# !stable-docs should only be in the one commit, so apply changes from that commit
git show ${{ github.sha }} -- docs/ | git apply -
git add docs/
git commit -m "Cherry-picked docs changes from ${{ github.sha }}" || true
git push origin stable-docs
PATCH=$(git show ${{ github.sha }} -- docs/)
# Check if patch is non-empty
if [[ -n "$PATCH" ]]; then
echo "$PATCH" | git apply -
git add docs/
git commit -m "Cherry-picked docs changes from ${{ github.sha }}"
git push origin stable-docs
else
echo "No changes to docs/ in this commit."
exit 0
fi

0 comments on commit ef6e723

Please sign in to comment.