mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-22 14:19:57 +08:00
ci(px4_msgs): pass the push token through gh's credential helper
Since the runner image rotation on 2026-10-20 every sync has failed to push to PX4/px4_msgs with "could not read Username for 'https://github.com'". The token was never rejected: the image carries libcurl 7.81.0-1ubuntu1.30, whose CVE-2026-94266 fix strips credentials from CURLINFO_EFFECTIVE_URL, and git 2.55 compares that against the URL it requested, reports a redirect that never happened and re-derives its credentials from the stripped URL. A token embedded as the URL username is therefore dropped before the push. Clone px4_msgs without credentials and let gh's credential helper supply the token from GH_TOKEN. This is the interface git and GitHub provide for this, it survives the libcurl change on both the current and the previous image, and it keeps the token out of argv and .git/config on the runner. Reproduced with the runner's exact git 2.55.0 PPA build against the patched jammy libcurl: the URL form fails identically, the credential helper path sends the credentials. Assisted-by: Claude:claude-mythos-5-1 Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
1 parent
d6cd502f2d
commit
d02e110e97
1 file changed
+9
-1
@@ -18,6 +18,9 @@ jobs:
|
||||
sync_to_px4_msgs:
|
||||
if: github.repository == 'PX4/PX4-Autopilot'
|
||||
runs-on: [runs-on,runner=4cpu-linux-x64,image=ubuntu22-full-x64,"run-id=${{ github.run_id }}",spot=false]
|
||||
env:
|
||||
# read by gh's git credential helper at push time
|
||||
GH_TOKEN: ${{ secrets.PX4BUILTBOT_PERSONAL_ACCESS_TOKEN }}
|
||||
steps:
|
||||
- name: Checkout PX4 repo
|
||||
uses: actions/checkout@v6
|
||||
@@ -26,10 +29,15 @@ jobs:
|
||||
run: |
|
||||
git config --global user.name "${{ secrets.PX4BUILDBOT_USER }}"
|
||||
git config --global user.email "${{ secrets.PX4BUILDBOT_EMAIL }}"
|
||||
# Hand the token to git through gh's credential helper instead of the clone URL.
|
||||
# libcurl with the CVE-2026-94266 fix strips credentials from the effective URL,
|
||||
# and git 2.55 mistakes that for a redirect and drops them, so a token embedded
|
||||
# in the URL is never sent on push.
|
||||
gh auth setup-git
|
||||
|
||||
- name: Clone PX4_msgs repo
|
||||
run: |
|
||||
git clone https://${{ secrets.PX4BUILTBOT_PERSONAL_ACCESS_TOKEN }}@github.com/PX4/px4_msgs.git
|
||||
git clone https://github.com/PX4/px4_msgs.git
|
||||
|
||||
- name: Check out the same branch as the PX4 repo
|
||||
run: |
|
||||
|
||||
Reference in new issue
Block a user