Skip to content

Commit 022e8ba

Browse files
authored
fix(ci): configure git remote with token for authentication (#26949)
1 parent 120dfc7 commit 022e8ba

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/actions/publish-release/action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,14 @@ runs:
114114
BRANCH_NAME: '${{ steps.release_branch.outputs.BRANCH_NAME }}'
115115
DRY_RUN: '${{ inputs.dry-run }}'
116116
RELEASE_TAG: '${{ inputs.release-tag }}'
117+
GIT_PUSH_TOKEN: '${{ inputs.github-release-token || inputs.github-token }}'
117118
run: |-
118119
set -e
119120
git add package.json package-lock.json packages/*/package.json
120121
git commit -m "chore(release): ${RELEASE_TAG}"
121122
if [[ "${DRY_RUN}" == "false" ]]; then
122123
echo "Pushing release branch to remote..."
123-
git push --set-upstream origin "${BRANCH_NAME}" --follow-tags
124+
git push "https://x-access-token:${GIT_PUSH_TOKEN}@github.com/${{ github.repository }}.git" "HEAD:${BRANCH_NAME}" --follow-tags
124125
else
125126
echo "Dry run enabled. Skipping push."
126127
fi
@@ -336,7 +337,8 @@ runs:
336337
shell: 'bash'
337338
run: |
338339
echo "Cleaning up release branch ${STEPS_RELEASE_BRANCH_OUTPUTS_BRANCH_NAME}..."
339-
git push origin --delete "${STEPS_RELEASE_BRANCH_OUTPUTS_BRANCH_NAME}"
340+
git push "https://x-access-token:${GIT_PUSH_TOKEN}@github.com/${{ github.repository }}.git" --delete "${STEPS_RELEASE_BRANCH_OUTPUTS_BRANCH_NAME}"
340341
341342
env:
343+
GIT_PUSH_TOKEN: '${{ inputs.github-release-token || inputs.github-token }}'
342344
STEPS_RELEASE_BRANCH_OUTPUTS_BRANCH_NAME: '${{ steps.release_branch.outputs.BRANCH_NAME }}'

.github/workflows/release-promote.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ jobs:
403403
BRANCH_NAME: '${{ steps.release_branch.outputs.BRANCH_NAME }}'
404404
DRY_RUN: '${{ github.event.inputs.dry_run }}'
405405
NEEDS_CALCULATE_VERSIONS_OUTPUTS_NEXT_NIGHTLY_VERSION: '${{ needs.calculate-versions.outputs.NEXT_NIGHTLY_VERSION }}'
406+
GIT_PUSH_TOKEN: '${{ secrets.GEMINI_CLI_ROBOT_GITHUB_PAT }}'
406407
run: |-
407408
git add package.json packages/*/package.json
408409
if [ -f package-lock.json ]; then
@@ -411,7 +412,7 @@ jobs:
411412
git commit -m "chore(release): bump version to ${NEEDS_CALCULATE_VERSIONS_OUTPUTS_NEXT_NIGHTLY_VERSION}"
412413
if [[ "${DRY_RUN}" == "false" ]]; then
413414
echo "Pushing release branch to remote..."
414-
git push --set-upstream origin "${BRANCH_NAME}"
415+
git push "https://x-access-token:${GIT_PUSH_TOKEN}@github.com/${{ github.repository }}.git" "HEAD:${BRANCH_NAME}" --follow-tags
415416
else
416417
echo "Dry run enabled. Skipping push."
417418
fi

.github/workflows/release-rollback.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ jobs:
193193
run: |
194194
echo "ROLLBACK_TAG=$ROLLBACK_TAG_NAME" >> "$GITHUB_OUTPUT"
195195
git tag "$ROLLBACK_TAG_NAME" "${ORIGIN_HASH}"
196-
git push origin --tags
196+
git push "https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git" --tags
197197
198198
- name: 'Verify Rollback Tag Added'
199199
if: "${{ github.event.inputs.dry-run == 'false' }}"

0 commit comments

Comments
 (0)