Skip to content

Commit 0fbe7bb

Browse files
cguldnerclaude
andauthored
Close stale spec-update PRs and include date in title (#550)
* Close stale spec-update PRs before opening a new one Add a step to close any existing open PRs with the "automated-spec-update" label before creating a new PR, and label new PRs accordingly. Also removes team-reviewers since the app token cannot request team reviews. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Close stale spec-update PRs and include date in PR title - Add a step to close existing open PRs with the "automated-spec-update" label before creating a new one, preventing stale PRs from accumulating - Include the formatted date in the PR title for easier identification - Label new spec-update PRs with "automated-spec-update" - Remove team-reviewers (the app token cannot request team reviews) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1a88d99 commit 0fbe7bb

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/spec_update.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,17 @@ jobs:
8484
python -m pip install --upgrade pip
8585
pip install -r requirements.txt
8686
python generate_base_client.py
87+
88+
- name: Close Old Pull Requests
89+
if: steps.git-diff-num.outputs.num-diff != 0
90+
run: |
91+
gh pr list --label "automated-spec-update" --state open --json number --jq '.[].number' | while read -r pr_num; do
92+
echo "Closing old PR #$pr_num"
93+
gh pr close "$pr_num" --delete-branch
94+
done
95+
env:
96+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
97+
8798
- name: Create Pull Request
8899
id: create-pr
89100
uses: peter-evans/create-pull-request@v8
@@ -94,13 +105,12 @@ jobs:
94105
${{ steps.git-diff.outputs.commit}}
95106
branch: ${{ steps.git-branch.outputs.branch }}
96107
delete-branch: true
97-
title: 'Automated Spec Update'
108+
title: 'Automated Spec Update - ${{ steps.current-time.outputs.formattedTime }}'
98109
body: |
99110
${{ steps.git-diff.outputs.commit}}
100111
base: 'main'
101-
team-reviewers: |
102-
owners
103-
maintainers
112+
labels: |
113+
automated-spec-update
104114
draft: false
105115
106116
# - name: Enable Pull Request Automerge

0 commit comments

Comments
 (0)