Use PAT to trigger CI workflows in VRT update workflow (#6363)

This commit is contained in:
Matiss Janis Aboltins
2025-12-11 21:02:10 +00:00
committed by GitHub
parent 9c9a98844f
commit b99d3ab802
2 changed files with 11 additions and 3 deletions

View File

@@ -59,6 +59,7 @@ jobs:
repository: ${{ steps.metadata.outputs.head_repo }}
ref: ${{ steps.metadata.outputs.head_ref }}
token: ${{ secrets.ACTIONS_UPDATE_TOKEN }}
persist-credentials: false
fetch-depth: 0
- name: Validate and apply patch
@@ -123,9 +124,10 @@ jobs:
HEAD_REPO: ${{ steps.metadata.outputs.head_repo }}
GITHUB_TOKEN: ${{ secrets.ACTIONS_UPDATE_TOKEN }}
run: |
# Configure git to use the token via credential helper (avoids token in URLs/logs)
git config --local credential.helper '!f() { echo "username=x-access-token"; echo "password=${GITHUB_TOKEN}"; }; f'
git remote set-url origin "https://github.com/${HEAD_REPO}.git"
# Use PAT in URL to ensure push triggers CI workflows
# Note: GitHub Actions automatically masks secrets in logs
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${HEAD_REPO}.git"
git push origin "HEAD:refs/heads/$HEAD_REF"
echo "Successfully pushed VRT updates to $HEAD_REPO@$HEAD_REF"

View File

@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [MatissJanis]
---
Another approach at triggering ci jobs after update-vrt workflow