This action does the following:
This action has a user defined environment variable of NUM_OF_POSTS
, which is equal to an integer value of the number of blog posts you wish to live in your Jekyll blog post repository. For example, if you define 6
then the action will check that the latest DEV blog post is not newer than the top 6 blog posts in your repository. If it is, then it will remove the oldest one of the 6 and add the newest DEV blog post as markdown to your Jekyll site in the form of a pull request.
To use this action in your Jekyll blog post repository, you need to do the following:
.github/workflows
folder to your repositorydev-to-md.yml
file in the foldername: Convert DEV Posts to Markdown
on:
schedule:
# At midnight twice a week on Monday and Fridayday
- cron: '0 0 * * 1,5'
jobs:
dev-to-md:
runs-on: ubuntu-latest
steps:
- name: dev-to-md
uses: coderganesh/Dev.to-md@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
DEV_API_KEY: "${{ secrets.DEV_API_KEY }}"
NUM_OF_POSTS: "${{ secrets.NUM_OF_POSTS }}"
DEV_API_KEY
(Your API key from DEV.to)NUM_OF_POSTS
(The maximum number of posts)REPO_OWNER
(The owner of the repository, i.e. "jane")REPO
(Your repository name, i.e. "sample-repository")We welcome contributions! Please follow the GitHub flow when introducing changes. If it recommended to open an Issue first, so it can be discussed and collaborated on before you start working on what you plan.
This project is under the Apache 2.0 License.