Collect your latest articles from sources such as dev.to, and then update the README.md
.
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.yml
in 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
fi
Step 5: Commit your change, then Github actions will run as your specified cron to update Articles into your README.md file
![]() |
Graphql Fundamental
GraphQL provides a complete and understandable description of the API, including both "API endpoints"...
03/07/2024
|
![]() |
Snowflake Schema vs. Star Schema: Pros, Cons, and Use Cases
Star Schema Structure: Central Fact Table: Contains quantitative data for...
11/06/2024
|
![]() |
Is JWT Safe When Anyone Can Decode Plain Text Claims
If I get a JWT and can decode the payload, how is it secure? Why couldn't I just grab the token out...
06/06/2024
|
![]() |
Understanding the "SELECT FOR UPDATE" SQL Statement
What is "SELECT FOR UPDATE"? SELECT FOR UPDATE is a clause in SQL that is appended to a...
06/06/2024
|
![]() |
Managing Concurrent Purchases of Limited Items in a Database
Imagine that we're developing an e-commerce website. In this case, we have a limited number of items...
06/06/2024
|
- Graphql Fundamental - 03/07/2024
- Snowflake Schema vs. Star Schema: Pros, Cons, and Use Cases - 11/06/2024
- Is JWT Safe When Anyone Can Decode Plain Text Claims - 06/06/2024
- Understanding the "SELECT FOR UPDATE" SQL Statement - 06/06/2024
- Managing Concurrent Purchases of Limited Items in a Database - 06/06/2024
Updated at: 2024-07-03T06:33:21Z