Skip to content

Commit 5c8d986

Browse files
committed
fix(ci): tolerate refresh PR API errors
1 parent 00c7ccf commit 5c8d986

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
@@ -195,7 +195,9 @@ jobs:
195195

196196
# --- 4. Dated branch + auto PR against TechAPI (only with a PAT) ---
197197
- name: Create refresh PR
198+
id: create_pr
198199
if: env.TECHAPI_WRITE_TOKEN != ''
200+
continue-on-error: true
199201
uses: peter-evans/create-pull-request@v6
200202
with:
201203
path: ./techapi
@@ -212,3 +214,16 @@ jobs:
212214
committer: TechEngineBot <289859915+TechEngineBot@users.noreply.github.com>
213215
author: TechEngineBot <289859915+TechEngineBot@users.noreply.github.com>
214216
delete-branch: true
217+
218+
- name: Confirm refresh PR exists
219+
if: env.TECHAPI_WRITE_TOKEN != ''
220+
env:
221+
GH_TOKEN: ${{ env.TECHAPI_WRITE_TOKEN }}
222+
run: |
223+
pr_count="$(gh pr list --repo GetTechAPI/TechAPI --head refresh/${{ steps.meta.outputs.date }} --base main --state open --json number --jq length)"
224+
if [ "$pr_count" -gt 0 ]; then
225+
exit 0
226+
fi
227+
228+
echo "::error::Refresh PR refresh/${{ steps.meta.outputs.date }} was not created."
229+
exit 1

0 commit comments

Comments
 (0)