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
12 changes: 11 additions & 1 deletion .github/workflows/batch-assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,19 @@ jobs:
fi

if [ "${BATCH_SIZE:-0}" -gt 0 ]; then
# Save the script before git checkout may overwrite it with an older version
cp bin/batch_assign_entities.py /tmp/batch_assign_entities.py

# Switch to config-manager-update so pipeline files accumulate correctly across batches
if git show-ref --verify --quiet refs/heads/config-manager-update; then
git checkout config-manager-update
else
git checkout -b config-manager-update
fi

CURRENT_BATCH="${START_BATCH:-1}"
while true; do
python3 bin/batch_assign_entities.py "${ARGS[@]}" \
python3 /tmp/batch_assign_entities.py "${ARGS[@]}" \
--batch-size "$BATCH_SIZE" \
--start-batch "$CURRENT_BATCH"
EXIT=$?
Expand Down
4 changes: 0 additions & 4 deletions bin/batch_assign_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ def create_or_update_pr_for_success(branch, triggered_by, success_count, scope,

run_command(["git", "config", "user.name", "github-actions-add-data-bot"])
run_command(["git", "config", "user.email", "matthew.poole@communities.gov.uk"])

original_branch = run_command(["git", "rev-parse", "--abbrev-ref", "HEAD"], capture_output=True)
checkout_branch_for_create_mode(branch)

run_command(["git", "add", "pipeline/"])
Expand All @@ -99,12 +97,10 @@ def create_or_update_pr_for_success(branch, triggered_by, success_count, scope,

if not staged_changes:
print("No staged changes after batch assignment; skipping PR creation")
run_command(["git", "checkout", original_branch])
return

run_command(["git", "commit", "-m", commit_label])
run_command(["git", "push", "origin", branch])
run_command(["git", "checkout", original_branch])

pr_number = run_command(
[
Expand Down
Loading