Skip to content

Commit a095b7e

Browse files
repository_dispatchトリガーに対応する (#1095)
* repository_dispatchイベントに対応する * README修正 (#1096) 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 e0aeeef commit a095b7e

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
* push
5353
* schedule
5454
* workflow_dispatch
55+
* repository_dispatch
5556
5657
## 開発
5758

README.template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ ${INPUTS}
4545
* push
4646
* schedule
4747
* workflow_dispatch
48+
* repository_dispatch
4849
4950
## 開発
5051

action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ runs:
4646
TOKEN: ${{inputs.github-token}}
4747
REPOSITORY: ${{github.repository}}
4848
BRANCH_NAME_PREFIX: ${{inputs.branch-name-prefix}}
49-
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')
49+
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' || github.event_name == 'repository_dispatch')
5050
working-directory: ${{inputs.working-directory}}
5151
run: ${{ github.action_path }}/scripts/action/push.sh
5252
shell: bash
5353
- name: Set org name
5454
uses: actions/github-script@v6.4.1
55-
if: github.event_name == 'pull_request' || github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
55+
if: github.event_name == 'pull_request' || github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch'
5656
id: set_org_name
5757
with:
5858
github-token: ${{inputs.github-token}}
@@ -62,7 +62,7 @@ runs:
6262
return script()
6363
- name: Get PullRequests
6464
uses: actions/github-script@v6.4.1
65-
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')
65+
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' || github.event_name == 'repository_dispatch')
6666
id: get_pull_requests
6767
env:
6868
ORG_NAME: ${{steps.set_org_name.outputs.result}}
@@ -75,7 +75,7 @@ runs:
7575
# pushしたブランチでPRを作る
7676
- name: Create PullRequest
7777
uses: actions/github-script@v6.4.1
78-
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')
78+
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' || github.event_name == 'repository_dispatch')
7979
id: create_pull_request
8080
env:
8181
ORG_NAME: ${{steps.set_org_name.outputs.result}}
@@ -102,7 +102,7 @@ runs:
102102
# 既にformat修正のPRがある状態で、手動でformatを修正した場合、format修正のPRを閉じる
103103
- name: Close PullRequest
104104
uses: actions/github-script@v6.4.1
105-
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 == '')
105+
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' || github.event_name == 'repository_dispatch') && steps.diff.outputs.result == '')
106106
env:
107107
ORG_NAME: ${{steps.set_org_name.outputs.result}}
108108
BRANCH_NAME_PREFIX: ${{inputs.branch-name-prefix}}

0 commit comments

Comments
 (0)