Skip to content

Commit

Permalink
[add] GitHub issue template & actions of Crawler & Formatter (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
TechQuery authored May 3, 2024
1 parent 4fc3fbb commit 11c8fae
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 50 deletions.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/crawler.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 文章抓取
about: 自动抓取互联网文章,并转为 Markdown 文件保存
title: (文章标题)
labels:
- Article
- crawler
---

https://example.com/replace/this/with/your/original/article/URL
11 changes: 11 additions & 0 deletions .github/pr-badge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- icon: github
label: "GitHub codespaces"
message: "PR-$prNumber"
color: "black"
url: "https://codespaces.new/$owner/$repo/pull/$prNumber"

- icon: git
label: "GitPod.io"
message: "PR-$prNumber"
color: "orange"
url: "https://gitpod.io/?autostart=true#https://github.com/$owner/$repo/pull/$prNumber"
24 changes: 24 additions & 0 deletions .github/workflows/crawler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Fetch Web pages
on:
issues:
types:
- labeled
jobs:
Fetch-and-Save:
if: github.event.label.name == 'crawler'
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
steps:
- uses: actions/checkout@v4

- uses: freeCodeCamp-China/article-webpage-to-markdown-action@v1
with:
newsLink: "${{ github.event.issue.Body }}"
markDownFilePath: "./translation/"
githubToken: ${{ github.token }}

- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "${{ github.event.issue.title }}"
24 changes: 24 additions & 0 deletions .github/workflows/formatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Format Markdown files

on:
push:

jobs:
Lint-and-Format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: "lts/*"

- name: Lint & Format
run: pnpm --package=@lint-md/cli dlx lint-md **/*.md --fix

- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto Format
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
原文:https://s.apache.org/DiEo
石墨:https://shimo.im/docs/E6Dkds9neoUY9PsB
赢在Apache:精英治理
作者Kevin A. McGrail
---
originals:
- https://s.apache.org/DiEo
- https://shimo.im/docs/E6Dkds9neoUY9PsB
title: 赢在Apache:精英治理
author: Kevin A. McGrail
---

Apache软件基金会不是民主机构。

Expand Down
File renamed without changes.
File renamed without changes.

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions translation/the_apache_way_to_sustainable_os.md

Large diffs are not rendered by default.

0 comments on commit 11c8fae

Please sign in to comment.