Skip to content

Commit e4c22bd

Browse files
authored
CI 自体を失敗ステータスにするかどうかを利用者側が選択できるようにする (#1051)
* CI 自体を失敗ステータスにするかどうかを利用者側が選択できるようにする 当初想定されているユースケースとは外れていると思うけど、 Pull request ベースではないタイミングで差分の有無を確認し 差分があれば Pull request を作成したいため、正常に完了していれば CI の完了ステータスは成功となってほしい。 actions 利用者のユースケースによって最終的なステータス処理が異なる のでフラグで選択できるようにする。 * fix README
1 parent c7fdad5 commit e4c22bd

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
| branch-name-prefix | branch名の接頭語。 | |
4545
| pr-title-prefix | PRのタイトルの接頭語。 | |
4646
| pr-description-prefix | 本文の接頭語。 | |
47+
| exit-failure | 実行完了時にCIを失敗させるかどうか。 | |
4748
4849
## 対応しているトリガー
4950
* pull_request

action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ inputs:
1717
description: '本文の接頭語。'
1818
required: true
1919
default: ""
20+
exit-failure:
21+
description: '実行完了時にCIを失敗させるかどうか。'
22+
required: false
23+
default: "true"
2024
runs:
2125
using: "composite"
2226
steps:
@@ -102,6 +106,6 @@ runs:
102106
const script = require('${{ github.action_path }}/scripts/action/close_pull_request.js')
103107
await script({github, context})
104108
- name: Exit
105-
if: (github.event_name != 'pull_request' || github.event.action != 'closed') && steps.diff.outputs.result != ''
109+
if: (github.event_name != 'pull_request' || github.event.action != 'closed') && steps.diff.outputs.result != '' && inputs.exit-failure == 'true'
106110
run: exit 1
107111
shell: bash

0 commit comments

Comments
 (0)