File tree 1 file changed +8
-9
lines changed
1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 16
16
steps :
17
17
- name : Checkout repository
18
18
uses : actions/checkout@v3
19
-
19
+ with :
20
+ fetch-depth : 0 # We need all commits to find docs/ changes
20
21
- name : Set up Git user
21
22
run : |
22
23
git config user.name "Automated"
40
41
- name : Handle Commit to Main
41
42
if : contains(github.event.head_commit.message, '!stable-docs')
42
43
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
You can’t perform that action at this time.
0 commit comments