fix: reset git fetch auth to token #116

Merged
perl_d merged 1 commits from fix/workflow_fetch_auth_2 into main 2026-07-27 15:15:12 +02:00
+8
View File
@@ -20,6 +20,7 @@ jobs:
with:
ref: ${{ github.ref_name }}
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
@@ -31,6 +32,8 @@ jobs:
git reset --hard ${{ github.sha }}
- name: Evaluate | Verify upstream has NOT changed
shell: bash
env:
MX_GITEA_BOT_TOKEN: ${{ secrets.MX_GITEA_BOT_TOKEN }}
run: |
set +o pipefail
@@ -44,6 +47,11 @@ jobs:
exit 1
fi
# checkout ran with persist-credentials: false, so the remote carries no
# credentials; give it the bot token to reach this private repo.
git remote set-url "${UPSTREAM_BRANCH_NAME%%/*}" \
"https://${MX_GITEA_BOT_TOKEN}@gitea.psi.ch/${{ github.repository }}.git"
git fetch "${UPSTREAM_BRANCH_NAME%%/*}"
if ! UPSTREAM_SHA="$(git rev-parse "$UPSTREAM_BRANCH_NAME")"; then