Skip to content

Commit 837c1e6

Browse files
committed
inputを増やす
1 parent 5e5b326 commit 837c1e6

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

action.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ inputs:
44
github-token: # id of input
55
description: 'GITHUB_TOKEN'
66
required: true
7+
branch-name-prefix:
8+
description: 'Prefix of PR branch name'
9+
required: true
10+
pr-title-prefix:
11+
description: 'Prefix of PR title'
12+
required: true
713
runs:
814
using: "composite"
915
steps:
@@ -32,7 +38,7 @@ runs:
3238
REPO_URL="https://"
3339
REPO_URL+="${{github.actor}}:${{inputs.github-token}}@github.com/"
3440
REPO_URL+="${{github.repository}}.git"
35-
GITHUB_HEAD="HEAD:refs/heads/fix-text-${HEAD_REF}"
41+
GITHUB_HEAD="HEAD:refs/heads/${{inputs.branch-name-prefix}}-${HEAD_REF}"
3642
git push -f "${REPO_URL}" "${GITHUB_HEAD}"
3743
shell: bash
3844
- name: Set org name
@@ -56,7 +62,7 @@ runs:
5662
const pulls_list_params = {
5763
owner: context.repo.owner,
5864
repo: context.repo.repo,
59-
head: "${{steps.set_org_name.outputs.result}}:fix-text-" + HEAD_REF,
65+
head: "${{steps.set_org_name.outputs.result}}:${{inputs.branch-name-prefix}}-" + HEAD_REF,
6066
base: HEAD_REF,
6167
state: "open"
6268
}
@@ -78,12 +84,12 @@ runs:
7884
script: |
7985
const HEAD_REF = process.env["HEAD_REF"]
8086
const number = "#${{github.event.pull_request.number}}"
81-
let title = "日本語が間違ってたので直してあげたよ!PRをマージしてね! "
87+
let title = "${{inputs.pr-title-prefix}}PRをマージしてね! "
8288
title += number
8389
const pulls_create_params = {
8490
owner: context.repo.owner,
8591
repo: context.repo.repo,
86-
head: "${{steps.set_org_name.outputs.result}}:fix-text-" + HEAD_REF,
92+
head: "${{steps.set_org_name.outputs.result}}:${{inputs.branch-name-prefix}}-" + HEAD_REF,
8793
base: HEAD_REF,
8894
title,
8995
body: "鳩の唐揚げおいしい!😋😋😋 " + number
@@ -122,7 +128,7 @@ runs:
122128
github-token: ${{inputs.github-token}}
123129
script: |
124130
const HEAD_REF = process.env["HEAD_REF"]
125-
const head_name = "fix-text-" + HEAD_REF
131+
const head_name = "${{inputs.branch-name-prefix}}-" + HEAD_REF
126132
const common_params = {
127133
owner: context.repo.owner,
128134
repo: context.repo.repo

0 commit comments

Comments
 (0)