Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion .github/workflows/integration-batch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ jobs:
npm test

- name: Create or update PR integration -> main
id: integration_pr
if: ${{ steps.dryrun.outputs.dry_run != 'true' }}
env:
GH_TOKEN: ${{ github.token }}
Expand Down Expand Up @@ -242,8 +243,30 @@ jobs:
existing="$(gh pr list --repo "$REPO" --state open --head integration --base main --json number --jq '.[0].number // empty')"
if [ -n "$existing" ]; then
gh pr edit "$existing" --repo "$REPO" --title "integration" --body "$body"
integration_pr_number="$existing"
else
gh pr create --repo "$REPO" --head integration --base main --title "integration" --body "$body"
created_pr_url="$(gh pr create --repo "$REPO" --head integration --base main --title "integration" --body "$body")"
integration_pr_number="$(gh pr view "$created_pr_url" --repo "$REPO" --json number --jq '.number')"
fi

if [ -z "$integration_pr_number" ]; then
echo "Failed to determine integration PR number" >&2
exit 1
fi
echo "number=$integration_pr_number" >> "$GITHUB_OUTPUT"

- name: Label integration PR for snapshot review
if: ${{ steps.dryrun.outputs.dry_run != 'true' }}
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
run: |
snapshot_updates='${{ steps.merge.outputs.snapshot_updates }}'
integration_pr_number='${{ steps.integration_pr.outputs.number }}'
snapshot_file_count="$(echo "$snapshot_updates" | jq -r '(.files // []) | length' 2>/dev/null || echo 0)"

if [ "$snapshot_file_count" -gt 0 ]; then
gh pr edit "$integration_pr_number" --repo "$REPO" --add-label integration-needs-snapshot-review || true
fi

- name: Job summary
Expand Down
1 change: 1 addition & 0 deletions docs/INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The [`integration-batch` workflow](../.github/workflows/integration-batch.yml) a
- `integration-batch`: PR is queued for integration batching.
- `integrated`: PR was successfully merged into the `integration` branch by automation.
- `integration-failed`: automation attempted integration but hit a merge conflict.
- `integration-needs-snapshot-review`: applied to the generated `integration -> main` PR when snapshot auto-recovery updates snapshot files.

## Selection rules

Expand Down
Loading