@@ -11,15 +11,15 @@ jobs:
1111 runs-on : ubuntu-latest
1212
1313 steps :
14- - uses : actions/checkout@v2
14+ - uses : actions/checkout@v3
1515 with :
1616 # ここでsubmodule持ってくるとdetached headにcommitして死ぬ
1717 # submodule: 'recursive'
1818 fetch-depth : 0
1919 ref : ${{ github.event.pull_request.head.sha }}
2020 - run : echo "PYTHON_VERSION=$(cat .python-version)" >> "${GITHUB_ENV}"
2121 - name : Set up Python ${{ env.PYTHON_VERSION }}
22- uses : actions/setup-python@v2.3.2
22+ uses : actions/setup-python@v3
2323 with :
2424 python-version : ${{env.PYTHON_VERSION }}
2525 cache : pipenv
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