File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,18 +13,23 @@ jobs:
1313 steps :
1414 - name : Checkout main repo
1515 uses : actions/checkout@v4
16- - name : Configure Git
17- run : |
18- git config --global user.name "doc-bot"
19- git config --global user.email "bot@deviceofchoice.org"
2016 - name : Clone content repo
2117 run : |
2218 rm -rf src/content
2319 git clone https://github.com/deviceofchoice/blog.git src/content
24- rm -rf src/content/.git # Remove .git to avoid nested repo issues
20+ LAST_COMMIT_MSG=$(git -C src/content log --oneline -1 | cut -d' ' -f2-)
21+ LAST_AUTHOR_NAME=$(git -C src/content log --format='%an' -1)
22+ LAST_AUTHOR_EMAIL=$(git -C src/content log --format='%ae' -1)
23+ rm -rf src/content/.git
24+ echo "LAST_COMMIT_MSG=$LAST_COMMIT_MSG" >> $GITHUB_ENV
25+ echo "LAST_AUTHOR_NAME=$LAST_AUTHOR_NAME" >> $GITHUB_ENV
26+ echo "LAST_AUTHOR_EMAIL=$LAST_AUTHOR_EMAIL" >> $GITHUB_ENV
27+ - name : Configure Git
28+ run : |
29+ git config --global user.name "$LAST_AUTHOR_NAME"
30+ git config --global user.email "$LAST_AUTHOR_EMAIL"
2531 - name : Commit and push changes
2632 run : |
27- LAST_COMMIT_MSG=$(git -C src/content log --oneline -1 | cut -d' ' -f2-)
2833 git add src/content
2934 git commit -m "[CONTENT] $LAST_COMMIT_MSG" || echo "No changes"
3035 git push
You can’t perform that action at this time.
0 commit comments