Skip to content

Commit 14b1312

Browse files
Update blog-post-workflow.yml
1 parent ab95371 commit 14b1312

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed
Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
name: Latest blog post workflow
2+
23
on:
3-
schedule: # Run workflow automatically
4-
- cron: '0 * * * *' # Runs every hour, on the hour
5-
workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the GitHub Actions Workflow page directly
4+
push:
5+
branches:
6+
- main
67

78
jobs:
8-
update-readme-with-blog:
9-
name: Update this repo's README with latest blog posts
9+
update-readme:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v4
14-
- name: Pull in dev.to posts
15-
uses: gautamkrishnar/blog-post-workflow@1.8.8
16-
with:
17-
feed_list: "https://dev.to/feed/gautamkrishnar"
12+
- name: Checkout repository
13+
uses: actions/checkout@v2
14+
- name: Update README with latest blog posts
15+
run: |
16+
# your script to update README.md
17+
- name: Commit changes
18+
run: |
19+
git config --global user.name 'github-actions[bot]'
20+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
21+
git add README.md
22+
git commit -m "Updated with the latest blog posts"
23+
- name: Push changes
24+
env:
25+
TOKEN: ${{ secrets.GH_TOKEN }}
26+
run: |
27+
git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }}
28+
git push origin HEAD:main

0 commit comments

Comments
 (0)