About
Collect your latest articles from sources such as dev.to, and then update the README.md.
Use GitHub Action to update your README
Step 1: In your repository, create a file named README.md.template.
Step 2: Write anything you want within the README.md.template file.
Step 3: Embed one of the following entities within your README.md.template:
- Article listing:
{{ template "article-list" .Articles }}- Article table:
{{ template "article-table" .Articles }}If you are familiar with Go templates, you have access to the root variable, which includes the following fields:
Articles: An array of Article. You can view the Article struct definition in model/article.go.Time: Updated TimeAuthor: Author of articles
Step 4: Register Github Action
- Create a file
.github/workflows/update-articles.ymlin your repository.
name: "Cronjob"
on:
schedule:
- cron: '15 0 * * *'
jobs:
update-articles:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Generate README
uses: huantt/article-listing@v1.1.0
with:
username: YOUR_USERNAME_ON_DEV_TO
template-file: 'README.md.template'
out-file: 'README.md'
limit: 5
- name: Commit
run: |
if git diff --exit-code; then
echo "No changes to commit."
exit 0
else
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "update"
git push origin main
fiStep 5: Commit your change, then Github actions will run as your specified cron to update Articles into your README.md file
Below is my recent articles Jack collected from dev.to
Table
|
Multiple git configs (profiles) on one computer
How to let git know which profile should be used in specific folders? Imagine that you’re...
26/10/2023
|
|
|
Explaining A/B testing algorithm
We are developing a crypto news aggregator Bitesapp.co. A few days ago, we implemented A/B testing...
25/10/2023
|
|
|
Understanding the Weighted Random Algorithm
Imagine you have a collection of items, and each item has a different "weight," or probability of...
24/10/2023
|
|
|
Migrate Redis to AWS ElastiCache
How to Migrate Redis from One Server to Another Starting from Redis version 5.0.0, Redis...
19/10/2023
|
|
![]() |
Writing Resume as Code - Why not?
Why I Developed Resume as Code I've explored various CV builder platforms over the...
12/10/2023
|
List
- Multiple git configs (profiles) on one computer - 26/10/2023
- Explaining A/B testing algorithm - 25/10/2023
- Understanding the Weighted Random Algorithm - 24/10/2023
- Migrate Redis to AWS ElastiCache - 19/10/2023
- Writing Resume as Code - Why not? - 12/10/2023
Updated at: 2023-12-08T06:28:54Z
