ci(digest): close existing open digest PRs before creating new one (#42)
Problem: if a digest PR is not merged before the next weekly run, a second PR is created for the same items plus any new ones, leading to duplicate open PRs. Solution: before fetching upstream activity, close any open PRs labeled upstream/digest (deleting their branches). The new run re-fetches all items since the last merged baseline and produces a single up-to-date PR.
This commit is contained in:
parent
56d1745415
commit
61e84bbc5f
1 changed files with 16 additions and 1 deletions
17
.github/workflows/upstream-digest.yml
vendored
17
.github/workflows/upstream-digest.yml
vendored
|
|
@ -15,6 +15,20 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Close existing digest PRs
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh pr list \
|
||||
--repo barrettruth/canola.nvim \
|
||||
--label "upstream/digest" \
|
||||
--state open \
|
||||
--json number \
|
||||
--jq '.[].number' \
|
||||
| xargs -r -I{} gh pr close {} \
|
||||
--repo barrettruth/canola.nvim \
|
||||
--delete-branch
|
||||
|
||||
- name: Update upstream tracker
|
||||
id: digest
|
||||
env:
|
||||
|
|
@ -42,5 +56,6 @@ jobs:
|
|||
--title "docs(upstream): add digest for week of ${DATE}" \
|
||||
--body "Automated weekly digest of new upstream activity. Triage by updating statuses and notes." \
|
||||
--base main \
|
||||
--head "${BRANCH}")
|
||||
--head "${BRANCH}" \
|
||||
--label "upstream/digest")
|
||||
gh pr merge "${PR_URL}" --auto --squash
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue