9292 REPO_URL+="${{github.repository}}.git"
9393 GITHUB_HEAD="HEAD:refs/heads/fix-format-${HEAD_REF}"
9494 git push -f "${REPO_URL}" "${GITHUB_HEAD}"
95+ - name : Set org name
96+ uses : actions/github-script@v6
97+ if : env.REPO_NAME == github.repository
98+ id : set_org_name
99+ with :
100+ github-token : ${{secrets.GITHUB_TOKEN}}
101+ result-encoding : string
102+ script :
103+ return process.env.GITHUB_REPOSITORY.split('/')[0]
95104 - name : Get PullRequests
96105 uses : actions/github-script@v6
97106 env :
@@ -107,7 +116,7 @@ jobs:
107116 const pulls_list_params = {
108117 owner: context.repo.owner,
109118 repo: context.repo.repo,
110- head: "dev-hato :fix-format-" + HEAD_REF,
119+ head: "${{steps.set_org_name.outputs.result}} :fix-format-" + HEAD_REF,
111120 base: HEAD_REF,
112121 state: "open"
113122 }
@@ -135,7 +144,7 @@ jobs:
135144 const pulls_create_params = {
136145 owner: context.repo.owner,
137146 repo: context.repo.repo,
138- head: "dev-hato :fix-format-" + HEAD_REF,
147+ head: "${{steps.set_org_name.outputs.result}} :fix-format-" + HEAD_REF,
139148 base: HEAD_REF,
140149 title,
141150 body: "鳩の唐揚げおいしい!😋😋😋 " + number
@@ -182,7 +191,7 @@ jobs:
182191 repo: context.repo.repo
183192 }
184193 const pulls_list_params = {
185- head: "dev-hato :" + head_name,
194+ head: "${{steps.set_org_name.outputs.result}} :" + head_name,
186195 base: HEAD_REF,
187196 state: "open",
188197 ...common_params
0 commit comments