首页 > 其他分享 >use GitHub Actions auto generator markdown file

use GitHub Actions auto generator markdown file

时间:2023-03-17 15:12:17浏览次数:55  
标签:use markdown name generator issue github xgqfrms com

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

image

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

(

标签:use,markdown,name,generator,issue,github,xgqfrms,com
From: https://www.cnblogs.com/xgqfrms/p/17226860.html

相关文章