Skip to content

Commit 58788a6

Browse files
committed
[optimize] comment Post URL to Post issues
[optimize] update upstream GitHub actions
1 parent 1d64148 commit 58788a6

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

.github/workflows/fetch-Web.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- id: fetch-md
2222
uses: freeCodeCamp-China/article-webpage-to-markdown-action@v2
2323
with:
24-
pageURL: "${{ steps.issue-parser.outputs.issueparser_page_link }}"
24+
pageURL: "${{ steps.issue-parser.outputs.issueparser_page_link }}"
2525
markdownFolder: "./_drafts/Article/Translation/"
2626
githubToken: ${{ github.token }}
2727

.github/workflows/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout Data repository
11-
uses: actions/checkout@v3
11+
uses: actions/checkout@v4
1212
with:
1313
lfs: true
1414
- name: Checkout Program repository
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616
with:
1717
repository: ${{ secrets.GIT_URI }}
1818
path: super/
@@ -23,18 +23,18 @@ jobs:
2323
shopt -s dotglob
2424
rm -rf .git/ .github/
2525
mv super/* .
26-
- uses: pnpm/action-setup@v2
26+
- uses: pnpm/action-setup@v4
2727
with:
2828
version: 9
29-
- uses: actions/setup-node@v3
29+
- uses: actions/setup-node@v4
3030
with:
31-
node-version: 18
31+
node-version: "lts/*"
3232
cache: pnpm
3333
- name: Install & Build
3434
run: pnpm i && pnpm build
3535

3636
- name: Deploy
37-
uses: peaceiris/actions-gh-pages@v3
37+
uses: peaceiris/actions-gh-pages@v4
3838
with:
3939
publish_dir: ./public
4040
cname: fcc-cd.dev

.github/workflows/save-activity.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
permissions:
1111
contents: write
12+
issues: write
1213
pull-requests: write
1314
steps:
1415
- uses: actions/checkout@v4
@@ -20,12 +21,13 @@ jobs:
2021

2122
- name: Generate Markdown file
2223
env:
24+
FILE_NAME: ${{ steps.issue-parser.outputs.issueparser_file_name }}
2325
CATEGORY: ${{ steps.issue-parser.outputs.issueparser_category }}
2426
TYPE: ${{ steps.issue-parser.outputs.issueparser_type }}
2527
PHOTOS: ${{ steps.issue-parser.outputs.issueparser_photos }}
2628
FILES: ${{ steps.issue-parser.outputs.issueparser_files }}
2729
run: |
28-
cat <<EOF > _posts/Activity/$CATEGORY/${{ steps.issue-parser.outputs.issueparser_file_name }}.md
30+
cat <<EOF > _posts/Activity/$CATEGORY/$FILE_NAME.md
2931
---
3032
title: "${{ github.event.issue.title }}"
3133
date: ${{ steps.issue-parser.outputs.issueparser_date || github.event.issue.created_at }}
@@ -48,6 +50,12 @@ jobs:
4850
${{ steps.issue-parser.outputs.issueparser_content }}
4951
EOF
5052
53+
POST_URL=$(echo "https://fcc-cd.dev/activity/$CATEGORY/$FILE_NAME" | tr '[:upper:]' '[:lower:]')
54+
55+
COMMENT_BODY="After the linked PR merged, the activity will be posted at: $POST_URL"
56+
57+
gh issue comment ${{ github.event.issue.number }} --body "$COMMENT_BODY"
58+
5159
- uses: peter-evans/create-pull-request@v7
5260
with:
5361
title: "[add] ${{ github.event.issue.title }} activity"

.github/workflows/save-article.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
permissions:
1111
contents: write
12+
issues: write
1213
pull-requests: write
1314
steps:
1415
- uses: actions/checkout@v4
@@ -20,10 +21,13 @@ jobs:
2021

2122
- name: Generate Markdown file
2223
env:
24+
FILE_NAME: ${{ steps.issue-parser.outputs.issueparser_file_name }}
2325
CATEGORIES: ${{ steps.issue-parser.outputs.issueparser_categories }}
2426
THUMBNAIL: ${{ steps.issue-parser.outputs.issueparser_thumbnail }}
2527
run: |
26-
cat <<EOF > _posts/$(echo $CATEGORIES | tr ',' '/')/${{ steps.issue-parser.outputs.issueparser_file_name }}.md
28+
FILE_PATH=$(echo $CATEGORIES | tr ',' '/')
29+
30+
cat <<EOF > _posts/$FILE_PATH/$FILE_NAME.md
2731
---
2832
title: "${{ github.event.issue.title }}"
2933
date: ${{ steps.issue-parser.outputs.issueparser_date || github.event.issue.created_at }}
@@ -39,6 +43,12 @@ jobs:
3943
${{ steps.issue-parser.outputs.issueparser_content }}
4044
EOF
4145
46+
POST_URL=$(echo "https://fcc-cd.dev/$FILE_PATH/$FILE_NAME" | tr '[:upper:]' '[:lower:]')
47+
48+
COMMENT_BODY="After the linked PR merged, the article will be posted at: $POST_URL"
49+
50+
gh issue comment ${{ github.event.issue.number }} --body "$COMMENT_BODY"
51+
4252
- uses: peter-evans/create-pull-request@v7
4353
with:
4454
title: "[add] ${{ github.event.issue.title }} article"

0 commit comments

Comments
 (0)