Skip to content

Commit 85f78b0

Browse files
committed
modified: .github/workflows/recent-posts.yml
- Added conditional to check if README.md has been modified. Add and commit the file if it has, otherwise exit.
1 parent d1b6d58 commit 85f78b0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/recent-posts.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
run: |
2323
git config user.email [email protected]
2424
git config user.name github-actions
25-
git add README.md
26-
git commit -m "Synced and updated with most recent it176131.github.io blog post"
27-
git push
25+
has_diff=$(git diff main --name-only -- README.md)
26+
if [ $has_diff ]; then
27+
git add README.md
28+
git commit -m "Synced and updated with most recent it176131.github.io blog post"
29+
git push
30+
fi

0 commit comments

Comments
 (0)