ci: post branch guidance before closing pull requests

This commit is contained in:
Darkatse 2026-09-09 00:07:17 -04:00
parent ba1a44f5b3
commit 69a1325e77

View file

@ -21,14 +21,14 @@ jobs:
const pull_number = context.payload.pull_request.number;
const guide = `https://github.com/${owner}/${repo}/blob/dev/CONTRIBUTING.md`;
await github.rest.pulls.update({ owner, repo, pull_number, state: 'closed' });
await github.rest.issues.createComment({
owner,
repo,
issue_number: pull_number,
body: [
`感谢您对 TauriTavern 的贡献!本项目的常规 PR 请提交到 \`dev\` 分支。由于此 PR 的目标分支不是 \`dev\`,机器人已将其关闭。请阅读 [贡献指南](${guide}),将目标分支改为 \`dev\` 后重新打开。如果这是必须直接提交到 \`main\` 的紧急修复,请说明原因并重新打开此 PR。`,
`Thank you for contributing to TauriTavern! Regular PRs should target \`dev\`. This PR has been automatically closed because it targets another branch. Please read [CONTRIBUTING.md](${guide}), change the target branch to \`dev\`, and reopen the PR. If this is an urgent fix that must go directly to \`main\`, please explain why and reopen this PR.`,
`感谢您对 TauriTavern 的贡献!本项目的常规 PR 请提交到 \`dev\` 分支。由于此 PR 的目标分支不是 \`dev\`,机器人将自动关闭此 PR。请阅读 [贡献指南](${guide}),将目标分支改为 \`dev\` 后重新打开。如果这是必须直接提交到 \`main\` 的紧急修复,请说明原因并重新打开此 PR。`,
`Thank you for contributing to TauriTavern! Regular PRs should target \`dev\`. This PR will be automatically closed because it targets another branch. Please read [CONTRIBUTING.md](${guide}), change the target branch to \`dev\`, and reopen the PR. If this is an urgent fix that must go directly to \`main\`, please explain why and reopen this PR.`,
].join('\n\n'),
});
await github.rest.pulls.update({ owner, repo, pull_number, state: 'closed' });