Skip to content

Commit f1c74cd

Browse files
fix readme (#100)
Co-authored-by: masaya.suzuki <suzukimasaya428@gmail.com>
1 parent 170488b commit f1c74cd

2 files changed

Lines changed: 50 additions & 3 deletions

File tree

README.md

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,54 @@
11
# actions-diff-pr-management
22

3-
diffを元にPRを作成するGitHub ActionsのWorkflowです。
3+
PRのブランチに対して、フォーマッタによって修正された結果を、PRにするGitHub Actionsです。
4+
5+
本Actionsを使わずにフォーマットを修正した場合、自動的にPRを閉じます。
6+
7+
## 注意点
8+
9+
元のPRを閉じた場合、本Actionsが立てたPRは残ります。
10+
このような場合、 <https://github.com/dev-hato/actions-close-pr> を併用することで自動的にPRを閉じることができます。
11+
12+
## 使い方
13+
14+
```yaml
15+
on:
16+
pull_request:
17+
18+
jobs:
19+
diff-pr-management:
20+
runs-on: ubuntu-latest
21+
if: github.event_name == 'pull_request'
22+
steps:
23+
- uses: actions/checkout@v3
24+
with:
25+
fetch-depth: 0
26+
ref: ${{ github.event.pull_request.head.sha }}
27+
- run: hoge fmt # FIXME フォーマッタを走らせる
28+
- uses: dev-hato/actions-diff-pr-management@v1
29+
with:
30+
github-token: ${{secrets.GITHUB_TOKEN}}
31+
repo-name: ${{ github.event.pull_request.head.repo.full_name }}
32+
```
33+
34+
## 例
35+
36+
* 元のPR: <https://github.com/dev-hato/actions-diff-pr-management/pull/96>
37+
* 本Actionsによって作成されたPR: <https://github.com/dev-hato/actions-diff-pr-management/pull/98>
38+
39+
## 引数
40+
41+
| 引数名 | 説明 | 必須 |
42+
|:---------------------:|:-------------------------------------------------------:|:---:|
43+
| github-token | GitHubのトークン。 | O |
44+
| repo-name | リポジトリ名。 `pull_request` 以外のトリガーも設定している場合はリポジトリ名を決め打ちで入力。 | O |
45+
| branch-name-prefix | branch名の接頭語。 | |
46+
| pr-title-prefix | PRのタイトルの接頭語。 | |
47+
| pr-description-prefix | 本文の接頭語。 | |
448

549
## 開発
650

751
### 設定
852

9-
<https://pre-commit.com/> の手順に従って `pre-commit` をインストールする
10-
これにより、[.pre-commit-config.yaml](.pre-commit-config.yaml)の設定に基づいて、コミット時にクレデンシャルが含まれていないかの検査が行われるようになる
53+
<https://pre-commit.com/> の手順に従って `pre-commit` をインストールします
54+
これにより、コミット時にクレデンシャルが含まれていないかの検査が行われるようになります

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ inputs:
88
branch-name-prefix:
99
description: 'Prefix of PR branch name'
1010
required: true
11+
default: fix
1112
pr-title-prefix:
1213
description: 'Prefix of PR title'
1314
required: true
15+
default: fix
1416
pr-description-prefix:
1517
description: 'Prefix of PR description'
1618
required: true
19+
default: ""
1720
repo-name:
1821
description: 'Repository name'
1922
required: true

0 commit comments

Comments
 (0)