Skip to content

Commit ef6e723

Browse files
authored
Handle empty patches, refs #1
1 parent 8d08021 commit ef6e723

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/stable-docs.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@ jobs:
4444
git fetch origin stable-docs:stable-docs
4545
git checkout stable-docs
4646
# !stable-docs should only be in the one commit, so apply changes from that commit
47-
git show ${{ github.sha }} -- docs/ | git apply -
48-
git add docs/
49-
git commit -m "Cherry-picked docs changes from ${{ github.sha }}" || true
50-
git push origin stable-docs
47+
PATCH=$(git show ${{ github.sha }} -- docs/)
48+
# Check if patch is non-empty
49+
if [[ -n "$PATCH" ]]; then
50+
echo "$PATCH" | git apply -
51+
git add docs/
52+
git commit -m "Cherry-picked docs changes from ${{ github.sha }}"
53+
git push origin stable-docs
54+
else
55+
echo "No changes to docs/ in this commit."
56+
exit 0
57+
fi

0 commit comments

Comments
 (0)