Skip to content

Commit d259447

Browse files
READMEに引数のデフォルト値追加 (#1052)
* READMEに引数のデフォルト値追加 * undefinedの場合はデフォルト値を記述しない * README修正 (#1053) 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 e4c22bd commit d259447

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ jobs:
3838
3939
## 引数
4040
41-
| 引数名 | 説明 | 必須 |
42-
|:---:|:---:|:---:|
43-
| github-token | GitHubのトークン。 | O |
44-
| branch-name-prefix | branch名の接頭語。 | |
45-
| pr-title-prefix | PRのタイトルの接頭語。 | |
46-
| pr-description-prefix | 本文の接頭語。 | |
47-
| exit-failure | 実行完了時にCIを失敗させるかどうか。 | |
41+
| 引数名 | 説明 | 必須 | デフォルト値 |
42+
|:---:|:---:|:---:|:--:|
43+
| github-token | GitHubのトークン。 | O | |
44+
| branch-name-prefix | branch名の接頭語。 | | fix |
45+
| pr-title-prefix | PRのタイトルの接頭語。 | | fix |
46+
| pr-description-prefix | 本文の接頭語。 | | |
47+
| exit-failure | 実行完了時にCIを失敗させるかどうか。 | | true |
4848
4949
## 対応しているトリガー
5050
* pull_request

scripts/update_readme/update_readme/get_inputs_markdown.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const yaml = require('js-yaml')
44
module.exports = () => {
55
const ymlFile = yaml.load(fs.readFileSync('action.yml', 'utf8'))
66
const inputs = ymlFile.inputs
7-
const rows = ['| 引数名 | 説明 | 必須 |', '|:---:|:---:|:---:|']
7+
const rows = ['| 引数名 | 説明 | 必須 | デフォルト値 |', '|:---:|:---:|:---:|:--:|']
88

99
for (const inputName of Object.keys(inputs)) {
1010
let row = `| ${inputName} | ${inputs[inputName].description} | `
@@ -13,6 +13,12 @@ module.exports = () => {
1313
row += 'O'
1414
}
1515

16+
row += ' | '
17+
18+
if (inputs[inputName].default !== undefined) {
19+
row += inputs[inputName].default
20+
}
21+
1622
row += ' |'
1723
rows.push(row)
1824
}

0 commit comments

Comments
 (0)