use GitHub Actions
auto generator markdown file ✅
GitHub Issues
Template +GitHub Actions
CI/CD
demos
Crawl pages and generate Markdown files
freeCodeCamp-China/[email protected]
name: Web Page To Markdown
on:
issues:
types: [opened]
jobs:
WebPageToMarkdown:
runs-on: ubuntu-latest
steps:
- name: Does the issue need to be converted to markdown
run: |
if [ "${{ github.event.issue.body }}" ]; then
if [[ "${{ github.event.issue.title }}" =~ ^\[Auto\]* ]]; then
:
else
echo "This issue does not need to generate a markdown file." 1>&2
exit 1;
fi;
else
echo "The description of the issue is empty." 1>&2
exit 1;
fi;
shell: bash
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Crawl pages and generate Markdown files
uses: freeCodeCamp-China/[email protected]
with:
newsLink: '${{ github.event.issue.Body }}'
markDownFilePath: './chinese/articles/'
githubToken: ${{ github.token }}
- name: Git Auto Commit
uses: stefanzweifel/[email protected]
with:
commit_message: '${{ github.event.issue.title }}'
file_pattern: chinese/articles/*.md
commit_user_name: PageToMarkdown Bot
commit_user_email: [email protected]
https://github.com/freeCodeCamp/chinese/blob/main/.github/workflows/WebPageToMarkdown.yml
https://github.com/freeCodeCamp/chinese/issues/1113