This repository has been archived by the owner on Aug 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
72 lines (62 loc) · 2.02 KB
/
CI-Contributors.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: CI | Contributors Update
on:
workflow_dispatch: {}
push:
branches:
- "main"
permissions:
contents: write
pull-requests: write
jobs:
contributor-update:
name: Contributors Update
runs-on: ubuntu-latest
if: github.repository == 'TeamKugimiya/ModsTranslationPack'
steps:
- name: Checking Repository
uses: actions/checkout@v4
- name: Generate Contributors Html Table
id: html_list
run: |
list_html=$(cat <<-EOF
python .github/scripts/contributors_generator.py
EOF
)
{
echo 'html_table<<EOF'
$list_html
echo EOF
} >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Print Html Table
run: |
cat << EOF
${{ steps.html_list.outputs.html_table }}
EOF
- name: Update Readme
run: |
python .github/scripts/content_replacer.py
env:
FILE_PATH: "README.md"
MULTILINE_MODE: true
START_TAG: "<!-- CONTRIBUTORS_CI_START -->"
END_TAG: "<!-- CONTRIBUTORS_CI_END -->"
CONTENT: "${{ steps.html_list.outputs.html_table }}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
title: "docs(Readme): 更新貢獻者清單"
commit-message: "docs(Readme): 更新貢獻者清單"
branch: docs/contributor-readme
labels: |
📃 文件
add-paths: README.md
body: |
自動化 [GitHub Action][github-action] 工作流程!
------
由 [create-pull-request][cpr] 自動產生
[cpr]: https://github.com/peter-evans/create-pull-request
[github-action]: https://github.com/features/actions