[歌词提交/修正][测试] HOYO-MiX - 测试提交 #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 缺少音源提醒 | |
on: | |
issue_comment: | |
types: [created] # 监听评论创建事件 | |
jobs: | |
add-slowqueue-label: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
- name: Get repository collaborators | |
id: get-collaborators | |
run: | | |
# 获取所有仓库协作者的 GitHub 用户名(包括管理员) | |
collaborators=$(gh repo collaborators --json login -q '.[].login') | |
echo "::set-output name=collaborators::$collaborators" | |
- name: Add "No Audio" label if "!slowqueue" command is used | |
if: contains(github.event.comment.body, '!slowqueue') && contains(steps.get-collaborators.outputs.collaborators, github.actor) | |
run: | | |
echo "Admin is adding 'Slow Queue' label to PR #${{ github.event.issue.number }}" | |
gh pr edit ${{ github.event.issue.number }} --add-label "缺少音源" | |
- name: Auto reply to PR with preset message | |
if: contains(github.event.comment.body, '!slowqueue') && contains(steps.get-collaborators.outputs.collaborators, github.actor) | |
run: | | |
echo "Admin is replying to PR #${{ github.event.issue.number }} with preset message" | |
# 使用 GitHub API 或 gh CLI 回复 PR 评论 | |
COMMENT_BODY="您好,您的投稿缺少对应音源,请向我们提供与之对应的音源以便审核,感谢您对本项目的支持!" | |
gh pr comment ${{ github.event.issue.number }} --body "$COMMENT_BODY" | |
env: | |
GITHUB_TOKEN: ${ secrets.GITHUB_TOKEN }} |