ci(digest): push branch with PAT so CI triggers
Problem: GITHUB_TOKEN suppresses all downstream workflow triggers including push events, so CI never runs on the digest branch. Solution: push with DIGEST_PAT (triggers CI as a real user push), then reset the remote to GITHUB_TOKEN for PR creation. Admin bypass on the ruleset handles the review requirement.
This commit is contained in:
parent
9ad67b05a6
commit
4f855b8a61
1 changed files with 5 additions and 3 deletions
8
.github/workflows/upstream-digest.yml
vendored
8
.github/workflows/upstream-digest.yml
vendored
|
|
@ -36,12 +36,14 @@ jobs:
|
||||||
git checkout -b "${BRANCH}"
|
git checkout -b "${BRANCH}"
|
||||||
git add doc/upstream.md
|
git add doc/upstream.md
|
||||||
git commit -m "docs(upstream): upstream digest $(date +%Y-%m-%d)"
|
git commit -m "docs(upstream): upstream digest $(date +%Y-%m-%d)"
|
||||||
|
git remote set-url origin "https://x-access-token:${{ secrets.DIGEST_PAT }}@github.com/barrettruth/canola.nvim.git"
|
||||||
git push --force origin "${BRANCH}"
|
git push --force origin "${BRANCH}"
|
||||||
if ! gh pr list --head "${BRANCH}" --state open --json number --jq '.[0].number' | grep -q .; then
|
if ! GH_TOKEN="${{ secrets.GITHUB_TOKEN }}" gh pr list --head "${BRANCH}" --state open --json number --jq '.[0].number' | grep -q .; then
|
||||||
PR_URL=$(gh pr create \
|
PR_URL=$(GH_TOKEN="${{ secrets.GITHUB_TOKEN }}" gh pr create \
|
||||||
--title "docs(upstream): upstream digest" \
|
--title "docs(upstream): upstream digest" \
|
||||||
--body "Automated weekly digest of new upstream activity. Triage by updating statuses and notes." \
|
--body "Automated weekly digest of new upstream activity. Triage by updating statuses and notes." \
|
||||||
--base main \
|
--base main \
|
||||||
--head "${BRANCH}")
|
--head "${BRANCH}")
|
||||||
gh pr merge "${PR_URL}" --auto --squash
|
GH_TOKEN="${{ secrets.DIGEST_PAT }}" gh pr review "${PR_URL}" --approve
|
||||||
|
GH_TOKEN="${{ secrets.GITHUB_TOKEN }}" gh pr merge "${PR_URL}" --auto --squash
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue