-
Notifications
You must be signed in to change notification settings - Fork 40
64 lines (57 loc) · 1.88 KB
/
Copy pathcheck-submit.yml
File metadata and controls
64 lines (57 loc) · 1.88 KB
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
name: 检查歌词提交正确性
on:
workflow_dispatch:
issues:
types: [opened, edited, labeled]
issue_comment:
types: [created]
concurrency:
group: check-submit-${{ github.event.issue.number || github.run_id }}
cancel-in-progress: true
permissions:
issues: write
pull-requests: write
contents: write
actions: write
jobs:
check-submit:
if: |
(github.event_name == 'issues' &&
contains(github.event.issue.title, '歌词') &&
(contains(github.event.issue.title, '补正') || contains(github.event.issue.title, '修正') || contains(github.event.issue.title, '提交'))
) ||
(github.event_name == 'issue_comment' && github.event.issue.pull_request != null && github.event.sender.type != 'Bot' && startsWith(github.event.comment.body, '/'))
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: 签出代码
uses: actions/checkout@v6
with:
fetch-depth: 0
sparse-checkout: |
raw-lyrics
scripts
metadata
.github
- name: 安装 Rust 环境
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: false
- name: 缓存 Cargo 依赖
uses: Swatinem/rust-cache@v2
with:
workspaces: ./scripts -> target
- name: 编译 Rust 程序
run: cargo build -p lyric_checker_bot
working-directory: scripts
- name: 运行检查程序
timeout-minutes: 10
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_EVENT_PATH: ${{ github.event_path }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
./target/debug/lyric_checker_bot
working-directory: scripts