GitHub Action PR Helper
Read this in other languages: English, 日本語.
PullRequest Helper for GitHub Actions.
Table of Contents
Usage
- Install
- npm
npm i @technote-space/github-action-pr-helper
- yarn
yarn add @technote-space/github-action-pr-helper
- npm
- Use
import { run } from '@technote-space/github-action-pr-helper';
run({
actionName: 'Test Action',
actionOwner: 'octocat',
actionRepo: 'hello-world',
});
Arguments
@see types.ts
Behavior
- Initialize working directory
- Clone branch named
${prBranchPrefix}${prBranchName}
- Check if clone is succeeded
3.a Succeeded
3.a.1 Merge head ref branch
3.a.2 Abort merge if failed merge
3.b Failed
3.b.1 Clone head ref branch
3.b.2 Create branch named${prBranchPrefix}${prBranchName}
- Run commands
- Check if there is a difference
5.a No difference
5.a.1 Find related Pull Request
5.a.2 Exit if there is no Pull Request
5.a.3 Close Pull Request and exit if there is no difference between HEAD and head ref
5.a.4 Get mergeable parameter of Pull Request
5.b There is a difference
5.b.1 Commit
5.b.2 Close Pull Request and exit if there is no difference between HEAD and head ref
5.b.3 Push
5.b.4 Create Pull Request or comment with command results
5.b.5 Get mergeable parameter of Pull Request - Resolve conflicts if it is not mergeable
6.1 Try to merge and push if merge is succeeded
6.2 Rebase if merge is failed
6.2.1 Initialize working directory
6.2.2 Clone head ref branch
6.2.3 Create branch named${prBranchPrefix}${prBranchName}
6.2.4 Run commands
6.2.5 Commit
6.2.6 Force push
6.2.7 Update Pull Request