Skip to content

Commit 5692dd6

Browse files
authored
Try a different pattern for !stable-docs refs #1
1 parent 4d33a39 commit 5692dd6

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

.github/workflows/stable-docs.yml

+8-9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ jobs:
1616
steps:
1717
- name: Checkout repository
1818
uses: actions/checkout@v3
19-
19+
with:
20+
fetch-depth: 0 # We need all commits to find docs/ changes
2021
- name: Set up Git user
2122
run: |
2223
git config user.name "Automated"
@@ -40,11 +41,9 @@ jobs:
4041
- name: Handle Commit to Main
4142
if: contains(github.event.head_commit.message, '!stable-docs')
4243
run: |
43-
git fetch --all
44-
git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | grep '^docs/' > changes.txt
45-
if [[ -s changes.txt ]]; then
46-
git checkout stable-docs
47-
git checkout ${{ github.sha }} -- $(cat changes.txt)
48-
git commit -m "Cherry-picked docs changes from ${{ github.sha }}"
49-
git push origin stable-docs
50-
fi
44+
# Apply all changes that affect docs/ directory
45+
for commit in $(git log --format="%H" origin/main ^origin/stable-docs); do
46+
git show $commit -- docs/ | git apply -
47+
git add docs/
48+
git commit -m "Cherry-picked docs changes from $commit" || true
49+
done

0 commit comments

Comments
 (0)