Skip to content

Commit ca86ed5

Browse files
committed
fix: try with real commit from content repo
1 parent 6c8bf19 commit ca86ed5

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

.github/workflows/update-blog-contents.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)