Skip to content

Commit aca69df

Browse files
simonjjCopilot
andcommitted
fix: make PR creation best-effort in workflow
The microsoft enterprise blocks Actions from creating PRs. Make it non-blocking so the data update branch still gets pushed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 594ea60 commit aca69df

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/region-discovery.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,19 @@ jobs:
7575
7676
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
7777
git push --force origin "$BRANCH"
78-
# Create or update pull request
79-
EXISTING_PR=$(gh pr list --head "$BRANCH" --json number --jq '.[0].number')
78+
echo "data_changed=true" >> "$GITHUB_OUTPUT"
79+
80+
# Create PR if one doesn't already exist (best-effort)
81+
EXISTING_PR=$(gh pr list --head "$BRANCH" --json number --jq '.[0].number' || true)
8082
if [ -z "$EXISTING_PR" ]; then
8183
gh pr create \
8284
--title "chore: update region availability data" \
8385
--body "Automated daily refresh of ACA region feature matrix." \
8486
--head "$BRANCH" \
85-
--base main
87+
--base main || echo "::warning::Could not create PR automatically. Please create one from branch $BRANCH."
88+
else
89+
echo "PR #$EXISTING_PR already exists"
8690
fi
87-
echo "data_changed=true" >> "$GITHUB_OUTPUT"
8891
fi
8992
env:
9093
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)