@technote-space/github-action-pr-helper
TypeScript icon, indicating that this package has built-in type declarations

2.4.1 • Public • Published

GitHub Action PR Helper

npm version CI Status codecov CodeFactor License: MIT

Read this in other languages: English, 日本語.

PullRequest Helper for GitHub Actions.

Table of Contents

Details

Usage

  1. Install
    • npm
      npm i @technote-space/github-action-pr-helper
    • yarn
      yarn add @technote-space/github-action-pr-helper
  2. Use
import { run } from '@technote-space/github-action-pr-helper';

run({
	actionName: 'Test Action',
	actionOwner: 'octocat',
	actionRepo: 'hello-world',
});

Arguments

@see types.ts

Behavior

  1. Initialize working directory
  2. Clone branch named ${prBranchPrefix}${prBranchName}
  3. 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}
  4. Run commands
  5. 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
  6. 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

Author

GitHub (Technote)
Blog

Readme

Keywords

Package Sidebar

Install

npm i @technote-space/github-action-pr-helper

Weekly Downloads

20

Version

2.4.1

License

MIT

Unpacked Size

114 kB

Total Files

20

Last publish

Collaborators

  • technote