@@ -309,14 +309,25 @@ jobs:
|
309 | 309 | if-no-files-found: ignore |
310 | 310 | retention-days: ${{ matrix.deep_profile == 'true' && 14 || 30 }} |
311 | 311 | |
312 | | - - name: Checkout clawgrit reports |
| 312 | + - name: Prepare clawgrit reports checkout |
313 | 313 | if: ${{ steps.kova.outputs.report_json != '' && steps.clawgrit.outputs.present == 'true' }} |
314 | | -uses: actions/checkout@v6 |
315 | | -with: |
316 | | -repository: openclaw/clawgrit-reports |
317 | | -path: .artifacts/clawgrit-reports |
318 | | -token: ${{ secrets.CLAWGRIT_REPORTS_TOKEN }} |
319 | | -persist-credentials: true |
| 314 | +env: |
| 315 | +CLAWGRIT_REPORTS_TOKEN: ${{ secrets.CLAWGRIT_REPORTS_TOKEN }} |
| 316 | +shell: bash |
| 317 | +run: | |
| 318 | + set -euo pipefail |
| 319 | + reports_root=".artifacts/clawgrit-reports" |
| 320 | + mkdir -p "$reports_root" |
| 321 | + git -C "$reports_root" init -b main |
| 322 | + git -C "$reports_root" remote add origin https://github.com/openclaw/clawgrit-reports.git |
| 323 | + auth_header="$(printf 'x-access-token:%s' "$CLAWGRIT_REPORTS_TOKEN" | base64 -w0)" |
| 324 | + git -C "$reports_root" config http.https://github.com/.extraheader "AUTHORIZATION: basic ${auth_header}" |
| 325 | + if git -C "$reports_root" ls-remote --exit-code --heads origin main >/dev/null 2>&1; then |
| 326 | + git -C "$reports_root" fetch --depth=1 origin main |
| 327 | + git -C "$reports_root" checkout -B main FETCH_HEAD |
| 328 | + else |
| 329 | + git -C "$reports_root" checkout -B main |
| 330 | + fi |
320 | 331 | |
321 | 332 | - name: Publish to clawgrit reports |
322 | 333 | if: ${{ steps.kova.outputs.report_json != '' && steps.clawgrit.outputs.present == 'true' }} |
@@ -358,4 +369,4 @@ jobs:
|
358 | 369 | exit 0 |
359 | 370 | fi |
360 | 371 | git -C "$reports_root" commit -m "perf: add OpenClaw ${LANE_ID} report ${GITHUB_SHA::12}" |
361 | | - git -C "$reports_root" push |
| 372 | + git -C "$reports_root" push origin HEAD:main |