@@ -176,30 +176,33 @@ runs:
176176 run : |
177177 "${{ steps.venv.outputs.python-path }}" -u main.py
178178
179- - name : GitHub Commit & Push (org homebrew repo)
179+ - name : GitHub Push (org homebrew repo)
180180 if : ${{ inputs.publish == 'true' }}
181- uses :
actions-js/[email protected] 182- with :
183- author_email : ${{ inputs.git_email }}
184- author_name : ${{ inputs.git_username }}
185- branch : ${{ steps.homebrew-tests.outputs.org_homebrew_repo_branch }}
186- directory : ${{ github.workspace }}/release_homebrew_action/org_homebrew_repo
187- github_token : ${{ inputs.token }}
188- message : " chore: ${{ steps.homebrew-tests.outputs.commit_message }}"
189- repository : ${{ inputs.org_homebrew_repo }}
181+ env :
182+ GH_TOKEN : ${{ inputs.token }}
183+ ORG_HOMEBREW_REPO_BRANCH : ${{ steps.homebrew-tests.outputs.org_homebrew_repo_branch }}
184+ INPUT_ORG_HOMEBREW_REPO : ${{ inputs.org_homebrew_repo }}
185+ shell : bash
186+ working-directory : ${{ github.workspace }}/release_homebrew_action/org_homebrew_repo
187+ run : |
188+ # Push the branch to remote
189+ git push https://x-access-token:${GH_TOKEN}@github.com/${INPUT_ORG_HOMEBREW_REPO}.git \
190+ ${ORG_HOMEBREW_REPO_BRANCH}:${ORG_HOMEBREW_REPO_BRANCH} \
191+ --force
190192
191- - name : GitHub Commit & Push (homebrew-core)
193+ - name : GitHub Push (homebrew-core)
192194 if : ${{ inputs.contribute_to_homebrew_core == 'true' && inputs.publish == 'true' }}
193- uses :
actions-js/[email protected] 194- with :
195- author_email : ${{ inputs.git_email }}
196- author_name : ${{ inputs.git_username }}
197- branch : ${{ steps.homebrew-tests.outputs.homebrew_core_branch }}
198- directory : ${{ github.workspace }}/release_homebrew_action/homebrew_core_fork_repo
199- force : true # need to force since the branch is sometimes reset
200- github_token : ${{ inputs.token }}
201- message : " ${{ steps.homebrew-tests.outputs.commit_message }}"
202- repository : ${{ inputs.homebrew_core_fork_repo }}
195+ env :
196+ GH_TOKEN : ${{ inputs.token }}
197+ HOMEBREW_CORE_BRANCH : ${{ steps.homebrew-tests.outputs.homebrew_core_branch }}
198+ HOMEBREW_CORE_FORK_REPO : ${{ inputs.homebrew_core_fork_repo }}
199+ shell : bash
200+ working-directory : ${{ github.workspace }}/release_homebrew_action/homebrew_core_fork_repo
201+ run : |
202+ # Push the branch to remote
203+ git push https://x-access-token:${GH_TOKEN}@github.com/${HOMEBREW_CORE_FORK_REPO}.git \
204+ ${HOMEBREW_CORE_BRANCH}:${HOMEBREW_CORE_BRANCH} \
205+ --force
203206
204207 - name : Create Pull Request (org homebrew repo)
205208 env :
@@ -217,21 +220,21 @@ runs:
217220
218221 # Check if a pull request already exists with the same head branch
219222 PR_EXISTS=$(gh pr list \
220- --head ${ORG_HOMEBREW_REPO_BRANCH} \
221- --repo ${INPUT_ORG_HOMEBREW_REPO})
223+ --head " ${ORG_HOMEBREW_REPO_BRANCH}" \
224+ --repo " ${INPUT_ORG_HOMEBREW_REPO}" )
222225
223226 # If the pull request does not exist, create it
224227 if [[ -z "$PR_EXISTS" ]]; then
225228 echo "Creating pull request"
226229
227230 # https://cli.github.com/manual/gh_pr_create
228231 gh pr create \
229- --base ${BASE_BRANCH} \
230- --head ${ORG_HOMEBREW_REPO_BRANCH} \
232+ --base " ${BASE_BRANCH}" \
233+ --head " ${ORG_HOMEBREW_REPO_BRANCH}" \
231234 --title "chore: ${COMMIT_MESSAGE}" \
232235 --body \
233236 "Created by the LizardByte [release_homebrew](https://github.com/LizardByte/actions) action" \
234- --repo ${INPUT_ORG_HOMEBREW_REPO}
237+ --repo " ${INPUT_ORG_HOMEBREW_REPO}"
235238 else
236239 echo "Pull request already exists"
237240 fi
@@ -257,8 +260,8 @@ runs:
257260 # Check if a pull request already exists from fork to upstream
258261 # We check in the upstream repo for PRs from our fork
259262 PR_EXISTS=$(gh pr list \
260- --head ${FORK_OWNER}:${HOMEBREW_CORE_BRANCH} \
261- --repo ${INPUT_UPSTREAM_HOMEBREW_CORE_REPO})
263+ --head " ${FORK_OWNER}:${HOMEBREW_CORE_BRANCH}" \
264+ --repo " ${INPUT_UPSTREAM_HOMEBREW_CORE_REPO}" )
262265
263266 # If the pull request does not exist, create it
264267 if [[ -z "$PR_EXISTS" ]]; then
@@ -268,9 +271,9 @@ runs:
268271 # Note: we're in the fork's working directory, so gh will use the fork's context
269272 # https://cli.github.com/manual/gh_pr_create
270273 gh pr create \
271- --repo ${INPUT_UPSTREAM_HOMEBREW_CORE_REPO} \
272- --base ${BASE_BRANCH} \
273- --head ${FORK_OWNER}:${HOMEBREW_CORE_BRANCH} \
274+ --repo " ${INPUT_UPSTREAM_HOMEBREW_CORE_REPO}" \
275+ --base " ${BASE_BRANCH}" \
276+ --head " ${FORK_OWNER}:${HOMEBREW_CORE_BRANCH}" \
274277 --title "${COMMIT_MESSAGE}" \
275278 --body "Created by the LizardByte [release_homebrew](https://github.com/LizardByte/actions) action"
276279 else
0 commit comments