Skip to content

Commit 42b7a5d

Browse files
committed
fix(ci): tolerate refresh PR API errors
1 parent 6612318 commit 42b7a5d

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎.github/workflows/weekly-refresh.yml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ jobs:
164164

165165
# --- 4. Dated branch + auto PR against TechAPI (only with a PAT) ---
166166
- name: Create refresh PR
167+
id: create_pr
167168
if: env.TECHAPI_WRITE_TOKEN != ''
169+
continue-on-error: true
168170
uses: peter-evans/create-pull-request@v6
169171
with:
170172
path: ./techapi
@@ -181,3 +183,16 @@ jobs:
181183
committer: TechEngineBot <289859915+TechEngineBot@users.noreply.github.com>
182184
author: TechEngineBot <289859915+TechEngineBot@users.noreply.github.com>
183185
delete-branch: true
186+
187+
- name: Confirm refresh PR exists
188+
if: env.TECHAPI_WRITE_TOKEN != ''
189+
env:
190+
GH_TOKEN: ${{ env.TECHAPI_WRITE_TOKEN }}
191+
run: |
192+
pr_count="$(gh pr list --repo GetTechAPI/TechAPI --head refresh/${{ steps.meta.outputs.date }} --base main --state open --json number --jq length)"
193+
if [ "$pr_count" -gt 0 ]; then
194+
exit 0
195+
fi
196+
197+
echo "::error::Refresh PR refresh/${{ steps.meta.outputs.date }} was not created."
198+
exit 1

0 commit comments

Comments
 (0)