xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

use GitHub Actions auto generator markdown file

use GitHub Actions auto generator markdown file ✅

GitHub Issues Template + GitHub Actions CI/CD

demos

Crawl pages and generate Markdown files

freeCodeCamp-China/article-webpage-to-markdown-action@v0.1.8

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/article-webpage-to-markdown-action@v0.1.8
        with:
          newsLink: '${{ github.event.issue.Body }}'
          markDownFilePath: './chinese/articles/'
          githubToken: ${{ github.token }}
      - name: Git Auto Commit
        uses: stefanzweifel/git-auto-commit-action@v4.9.2
        with:
          commit_message: '${{ github.event.issue.title }}'
          file_pattern: chinese/articles/*.md
          commit_user_name: PageToMarkdown Bot
          commit_user_email: PageToMarkdown-bot@freeCodeCamp.org

https://github.com/freeCodeCamp/chinese/blob/main/.github/workflows/WebPageToMarkdown.yml

image

https://github.com/freeCodeCamp/chinese/issues/1113

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

freecodecamp.org@xgqfrms

https://chinese.freecodecamp.org/news/ghost/#/staff/xgqfrms

refs

https://github.com/xgqfrms/GitHub-Actions-All-in-One/issues/5

https://github.com/xgqfrms/github-fe-oss-project-template

https://github.com/xgqfrms/hello-github-actions



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2023-03-17 15:04  xgqfrms  阅读(14)  评论(2编辑  收藏  举报