From fda4a15bf668cb6ee124eb8c01b842dc138eed10 Mon Sep 17 00:00:00 2001 From: snigupta Date: Wed, 7 Oct 2026 14:42:32 -0600 Subject: [PATCH 1/2] Add a workflow that merges GitHub MLDebugger main into GHE MLDebug main Signed-off-by: snigupta --- .github/workflows/mirror-enterprise.yml | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/mirror-enterprise.yml diff --git a/.github/workflows/mirror-enterprise.yml b/.github/workflows/mirror-enterprise.yml new file mode 100644 index 0000000..21469a8 --- /dev/null +++ b/.github/workflows/mirror-enterprise.yml @@ -0,0 +1,35 @@ +name: Mirror main to MLDebug + +on: + push: + branches: [ main ] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: mirror-mldebug-main + cancel-in-progress: false + +jobs: + mirror: + runs-on: [ vdi ] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Push main to enterprise + env: + ENTERPRISE_TOKEN: ${{ secrets.MLDEBUG_ENTERPRISE_TOKEN }} + run: | + auth=$(printf 'x-access-token:%s' "$ENTERPRISE_TOKEN" | base64 -w0) + hdr="http.extraHeader=AUTHORIZATION: basic ${auth}" + + git -c "$hdr" clone https://gitenterprise.xilinx.com/XDP/MLDebug.git "$RUNNER_TEMP/MLDebug" + cd "$RUNNER_TEMP/MLDebug" + git pull --no-rebase https://github.com/Xilinx/MLDebugger.git main + git -c "$hdr" push origin main + From 8e507d84f0679b3402cdbf03dd0033962d86f8a7 Mon Sep 17 00:00:00 2001 From: Snigdha Gupta <71372521+snigdha-gupta@users.noreply.github.com> Date: Thu, 8 Oct 2026 14:15:17 -0700 Subject: [PATCH 2/2] Update workflow file to take in username and password Signed-off-by: Snigdha Gupta <71372521+snigdha-gupta@users.noreply.github.com> --- .github/workflows/mirror-enterprise.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/mirror-enterprise.yml b/.github/workflows/mirror-enterprise.yml index 21469a8..30c4423 100644 --- a/.github/workflows/mirror-enterprise.yml +++ b/.github/workflows/mirror-enterprise.yml @@ -24,12 +24,14 @@ jobs: - name: Push main to enterprise env: ENTERPRISE_TOKEN: ${{ secrets.MLDEBUG_ENTERPRISE_TOKEN }} + GIT_TERMINAL_PROMPT: "0" + GIT_MERGE_AUTOEDIT: "no" run: | - auth=$(printf 'x-access-token:%s' "$ENTERPRISE_TOKEN" | base64 -w0) - hdr="http.extraHeader=AUTHORIZATION: basic ${auth}" - - git -c "$hdr" clone https://gitenterprise.xilinx.com/XDP/MLDebug.git "$RUNNER_TEMP/MLDebug" + # Send the username and token together. Answering only the password + # prompt can pair the token with the saved login name. + cred='!f() { echo username=x-access-token; echo "password=$ENTERPRISE_TOKEN"; }; f' + git -c credential.helper= -c "credential.helper=$cred" \ + clone https://gitenterprise.xilinx.com/XDP/MLDebug.git "$RUNNER_TEMP/MLDebug" cd "$RUNNER_TEMP/MLDebug" git pull --no-rebase https://github.com/Xilinx/MLDebugger.git main - git -c "$hdr" push origin main - + git -c credential.helper= -c "credential.helper=$cred" push origin main