Skip to content

Commit 6afd66d

Browse files
chore: use token when specifying origin in autoconfig generation (#3655)
* chore: use token when specifying origin in autoconfig generation * try inlining secret directly * specify token on checkout * try not persisting credentials * debug * remove debug output, try chaging origin * introduce test code * fail on error, print debug info * remove stash pop from test code * introduce author info to test code * test commit * comment out test code, ready for production test * remove test code * remove whitespace --------- Co-authored-by: Cloud Java Bot <[email protected]>
1 parent 548823f commit 6afd66d

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.github/workflows/generateAutoConfigs.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@ jobs:
1919
# log information required for manually triggering workflow and exit with error to block PR
2020
if: ${{ (github.event_name == 'workflow_dispatch') || startsWith(github.head_ref, 'renovate/main-gcp-libraries-bom.version') || startsWith(github.head_ref, 'dependabot/maven/com.google.cloud-libraries-bom') }}
2121
runs-on: ubuntu-latest
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}
2224
steps:
2325
- uses: actions/checkout@v4
26+
with:
27+
token: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}
28+
persist-credentials: false
2429
- name: Get PR info
2530
id: get_pr_info
2631
continue-on-error: false
@@ -57,8 +62,6 @@ jobs:
5762
uses: actions/setup-java@v1
5863
with:
5964
java-version: 17
60-
env:
61-
GITHUB_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}
6265
- run: bazelisk version
6366
- uses: actions/setup-go@v3
6467
- name: Install buildozer
@@ -147,6 +150,8 @@ jobs:
147150
git commit -m "chore: update starter modules in spring-cloud-previews"
148151
git push https://github.com/${{ github.event.inputs.forked_repo }}.git HEAD:${{ github.event.inputs.branch_name }}
149152
else
153+
git remote remove origin
154+
git remote add origin https://${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}@github.com/GoogleCloudPlatform/spring-cloud-gcp.git
150155
git fetch origin ${{ github.event.inputs.branch_name }}
151156
git checkout ${{ github.event.inputs.branch_name }}
152157
git reset --hard
@@ -156,7 +161,3 @@ jobs:
156161
git push -u origin ${{ github.event.inputs.branch_name }}
157162
fi
158163
159-
env:
160-
GITHUB_ACTOR_EMAIL: ${{ steps.determine_workflow_author_email.outputs.GITHUB_ACTOR_EMAIL }}
161-
GITHUB_ACTOR_NAME: ${{ steps.determine_workflow_author_email.outputs.GITHUB_ACTOR_NAME }}
162-
GITHUB_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}

test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test

0 commit comments

Comments
 (0)