Skip to content

[学校信息变更]:前郭二中 #176

[学校信息变更]:前郭二中

[学校信息变更]:前郭二中 #176

name: 学校信息审核通过回复
on:
issues:
types: [labeled]
jobs:
reply-when-approved:
runs-on: ubuntu-latest
if: github.event.label.name == '审核通过' && contains(github.event.issue.labels.*.name, '学校信息填报')
steps:
- name: 添加审核通过回复
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
// 检查是否已经回复过
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number
});
const hasReplied = comments.some(comment =>
comment.body.includes('✅ 审核成功') &&
comment.user.type === 'Bot'
);
if (!hasReplied) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
body: `✅ 审核通过\n\n您的学校信息审核成功,请等待维护人员将信息上传至网站。若14日内未上线,请联系\`wujingbo12@qq.com\``
});
console.log('自动回复已添加');
} else {
console.log('已回复过,跳过');
}