Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

[optimize] update Auto Tranlation infrastructure #430

[optimize] update Auto Tranlation infrastructure

[optimize] update Auto Tranlation infrastructure #430

name: Web page to Markdown
on:
pull_request:
paths:
- 'chinese/articles/**'
jobs:
WebPageToMarkdown:
runs-on: ubuntu-latest
permissions:
issues: write
contents: write
steps:
- name: Issue does not need to generate markdown
if: ${{ !startsWith(github.event.issue.title, '[Auto]') }}
shell: bash
run: echo "This issue does not need to generate a markdown file." 1>&2; exit 1;
- name: The description of the issue is empty
if: ${{ !github.event.issue.body }}
shell: bash
run: echo "The description of the issue is empty." 1>&2; exit 1;
- uses: actions/checkout@v4
- id: issue-parser
uses: stefanbuck/github-issue-parser@v3
with:
template-path: ".github/ISSUE_TEMPLATE/AutoGenerateMarkdown.yml"
- name: Crawl pages and generate Markdown files
uses: freeCodeCamp-China/article-webpage-to-markdown-action@v2
with:
pageURL: "${{ steps.issue-parser.outputs.issueparser_page_link }}"
excludedSelector: '.ad-wrapper'
markdownFolder: './chinese/articles/'
githubToken: ${{ github.token }}
- name: Git Auto Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: '${{ github.event.issue.title }}'
file_pattern: chinese/articles/*.md
commit_user_name: PageToMarkdown Bot
commit_user_email: PageToMarkdown-bot@freeCodeCamp.org