Skip to content

Commit

Permalink
fix: 合并拉取请求选择创建合并提交时无法触发
Browse files Browse the repository at this point in the history
创建合并提交时会触发一个 push 事件,名称为 Merge pull request
然后才是触发 pr closed 事件,名称才为合并提交中的最后一个提交
所以需要在 pr closed 事件中判断插件相关的拉取请求是否合并,并处理相关拉取请求的冲突
  • Loading branch information
he0119 committed Nov 22, 2020
1 parent 2b4a43b commit 503c995
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
16 changes: 12 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,13 @@ async function run(): Promise<void> {
core.info('对应分支不存在或已删除')
}
}
if (github.context.payload.pull_request?.merged) {
core.info('发布插件的拉取请求已合并,准备更新拉取请求的提交')
const pullRequests = await getAllPluginPullRequest(octokit)
resolveConflictPullRequests(octokit, pullRequests, base)
} else {
core.info('发布插件的拉取请求未合并,已跳过')
}
} else {
core.info('拉取请求与插件无关,已跳过')
}
Expand Down

0 comments on commit 503c995

Please sign in to comment.