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
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. 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/route
/some/other/route /some/other/route
```
如果你的 PR 与路由无关, 请在 route 区域 填写 `NOROUTE`,而不是直接删除 `routes` 区域。否则你的 PR 将会被无条件关闭。 如果你的 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. 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; let res = null;
const removeLabel = () => const removeLabel = () =>
github.issues github.rest.issues
.removeLabel({ .removeLabel({
issue_number: number, issue_number: number,
owner: context.repo.owner, owner: context.repo.owner,
@@ -23,7 +23,7 @@ module.exports = async ({ github, context, core }, body, number) => {
if (whiteListedUser.includes(context.payload.sender.login)) { if (whiteListedUser.includes(context.payload.sender.login)) {
core.info('PR created by a whitelisted user, passing'); core.info('PR created by a whitelisted user, passing');
await removeLabel(); await removeLabel();
await github.issues await github.rest.issues
.addLabels({ .addLabels({
issue_number: number, issue_number: number,
owner: context.repo.owner, owner: context.repo.owner,
@@ -45,7 +45,7 @@ module.exports = async ({ github, context, core }, body, number) => {
if (res.length > 0 && res[0] === 'NOROUTE') { if (res.length > 0 && res[0] === 'NOROUTE') {
core.info('PR stated no route, passing'); core.info('PR stated no route, passing');
await removeLabel(); await removeLabel();
await github.issues await github.rest.issues
.addLabels({ .addLabels({
issue_number: number, issue_number: number,
owner: context.repo.owner, owner: context.repo.owner,
@@ -66,7 +66,7 @@ module.exports = async ({ github, context, core }, body, number) => {
core.warning('seems no route found, failing'); core.warning('seems no route found, failing');
await github.issues await github.rest.issues
.addLabels({ .addLabels({
issue_number: number, issue_number: number,
owner: context.repo.owner, owner: context.repo.owner,
@@ -76,7 +76,7 @@ module.exports = async ({ github, context, core }, body, number) => {
.catch((e) => { .catch((e) => {
core.warning(e); core.warning(e);
}); });
await github.issues await github.rest.issues
.createComment({ .createComment({
issue_number: number, issue_number: number,
owner: context.repo.owner, owner: context.repo.owner,
@@ -87,7 +87,7 @@ Auto Route test failed, please check your PR body format and reopen pull request
.catch((e) => { .catch((e) => {
core.warning(e); core.warning(e);
}); });
await github.pulls await github.rest.pulls
.update({ .update({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, 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({ .addLabels({
issue_number: number, issue_number: number,
owner: context.repo.owner, owner: context.repo.owner,
@@ -52,7 +52,7 @@ module.exports = async ({ github, context, core }, baseUrl, routes, number) => {
.catch((e) => { .catch((e) => {
core.warning(e); core.warning(e);
}); });
github.issues github.rest.issues
.createComment({ .createComment({
issue_number: number, issue_number: number,
owner: context.repo.owner, owner: context.repo.owner,