fix(ci): `pr-deploy-route-test` workflow (#8611)

This commit is contained in:
Tony 2021-12-03 14:49:00 +11:00 committed by GitHub
parent d2666e517b
commit ea04c22ee8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 9 deletions

View File

@ -14,9 +14,10 @@ Close #
如果路由包含在文档中列出可以完全穷举的参数(例如分类),请依次全部列出。
Please include route starts with /, with all required and optional parameters. Fail to comply will result in your pull request being closed automatically.
```routes
```route
/some/route
/some/other/route
```
如果你的 PR 与路由无关, 请在 route 区域 填写 `NOROUTE`,而不是直接删除 `routes` 区域。否则你的 PR 将会被无条件关闭。
If your changes are not related to route, please fill in `routes` with `NOROUTE`. Fail to comply will result in your PR being closed.
-->

View File

@ -9,7 +9,7 @@ module.exports = async ({ github, context, core }, body, number) => {
let res = null;
const removeLabel = () =>
github.issues
github.rest.issues
.removeLabel({
issue_number: number,
owner: context.repo.owner,
@ -23,7 +23,7 @@ module.exports = async ({ github, context, core }, body, number) => {
if (whiteListedUser.includes(context.payload.sender.login)) {
core.info('PR created by a whitelisted user, passing');
await removeLabel();
await github.issues
await github.rest.issues
.addLabels({
issue_number: number,
owner: context.repo.owner,
@ -45,7 +45,7 @@ module.exports = async ({ github, context, core }, body, number) => {
if (res.length > 0 && res[0] === 'NOROUTE') {
core.info('PR stated no route, passing');
await removeLabel();
await github.issues
await github.rest.issues
.addLabels({
issue_number: number,
owner: context.repo.owner,
@ -66,7 +66,7 @@ module.exports = async ({ github, context, core }, body, number) => {
core.warning('seems no route found, failing');
await github.issues
await github.rest.issues
.addLabels({
issue_number: number,
owner: context.repo.owner,
@ -76,7 +76,7 @@ module.exports = async ({ github, context, core }, body, number) => {
.catch((e) => {
core.warning(e);
});
await github.issues
await github.rest.issues
.createComment({
issue_number: number,
owner: context.repo.owner,
@ -87,7 +87,7 @@ Auto Route test failed, please check your PR body format and reopen pull request
.catch((e) => {
core.warning(e);
});
await github.pulls
await github.rest.pulls
.update({
owner: context.repo.owner,
repo: context.repo.repo,

View File

@ -42,7 +42,7 @@ module.exports = async ({ github, context, core }, baseUrl, routes, number) => {
`;
}
}
github.issues
github.rest.issues
.addLabels({
issue_number: number,
owner: context.repo.owner,
@ -52,7 +52,7 @@ module.exports = async ({ github, context, core }, baseUrl, routes, number) => {
.catch((e) => {
core.warning(e);
});
github.issues
github.rest.issues
.createComment({
issue_number: number,
owner: context.repo.owner,