Skip to content

Commit 14f871b

Browse files
pushトリガー対応 (#628)
* pushトリガー対応 * ブランチ名修正 * 差分が発生しないようにしてみる * 動作確認用CI削除 * 対応しているトリガー記載 * README修正 (#631) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 0f6a2b1 commit 14f871b

3 files changed

Lines changed: 17 additions & 5 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ jobs:
4444
| pr-title-prefix | PRのタイトルの接頭語。 | |
4545
| pr-description-prefix | 本文の接頭語。 | |
4646
47+
## 対応しているトリガー
48+
* pull_request
49+
* push
50+
* schedule
51+
* workflow_dispatch
52+
4753
## 開発
4854
4955
### 設定

README.template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ jobs:
3939
4040
${INPUTS}
4141
42+
## 対応しているトリガー
43+
* pull_request
44+
* push
45+
* schedule
46+
* workflow_dispatch
47+
4248
## 開発
4349
4450
### 設定

action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ runs:
3737
GITHUB_TOKEN: ${{inputs.github-token}}
3838
REPOSITORY: ${{github.repository}}
3939
BRANCH_NAME_PREFIX: ${{inputs.branch-name-prefix}}
40-
if: steps.diff.outputs.result != '' && ((github.event_name == 'pull_request' && github.event.action != 'closed') || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
40+
if: steps.diff.outputs.result != '' && ((github.event_name == 'pull_request' && github.event.action != 'closed') || github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
4141
run: ${{ github.action_path }}/scripts/action/push.sh
4242
shell: bash
4343
- name: Set org name
4444
uses: actions/github-script@v6.3.3
45-
if: github.event_name == 'pull_request' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
45+
if: github.event_name == 'pull_request' || github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
4646
id: set_org_name
4747
with:
4848
github-token: ${{inputs.github-token}}
@@ -52,7 +52,7 @@ runs:
5252
return script()
5353
- name: Get PullRequests
5454
uses: actions/github-script@v6.3.3
55-
if: steps.diff.outputs.result != '' && ((github.event_name == 'pull_request' && github.event.action != 'closed') || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
55+
if: steps.diff.outputs.result != '' && ((github.event_name == 'pull_request' && github.event.action != 'closed') || github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
5656
id: get_pull_requests
5757
env:
5858
ORG_NAME: ${{steps.set_org_name.outputs.result}}
@@ -65,7 +65,7 @@ runs:
6565
# pushしたブランチでPRを作る
6666
- name: Create PullRequest
6767
uses: actions/github-script@v6.3.3
68-
if: steps.diff.outputs.result != '' && steps.get_pull_requests.outputs.result == 0 && ((github.event_name == 'pull_request' && github.event.action != 'closed') || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
68+
if: steps.diff.outputs.result != '' && steps.get_pull_requests.outputs.result == 0 && ((github.event_name == 'pull_request' && github.event.action != 'closed') || github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
6969
id: create_pull_request
7070
env:
7171
ORG_NAME: ${{steps.set_org_name.outputs.result}}
@@ -92,7 +92,7 @@ runs:
9292
# 既にformat修正のPRがある状態で、手動でformatを修正した場合、format修正のPRを閉じる
9393
- name: Close PullRequest
9494
uses: actions/github-script@v6.3.3
95-
if: (github.event_name == 'pull_request' && (github.event.action == 'closed' || steps.diff.outputs.result == '')) || ((github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && steps.diff.outputs.result == '')
95+
if: (github.event_name == 'pull_request' && (github.event.action == 'closed' || steps.diff.outputs.result == '')) || ((github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && steps.diff.outputs.result == '')
9696
env:
9797
ORG_NAME: ${{steps.set_org_name.outputs.result}}
9898
BRANCH_NAME_PREFIX: ${{inputs.branch-name-prefix}}

0 commit comments

Comments
 (0)