Skip to content

Conversation

@smockle
Copy link
Collaborator

@smockle smockle commented Oct 20, 2025

@smockle smockle requested a review from a team as a code owner October 20, 2025 17:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR backports cleanup improvements from the main branch to the v2 branch, specifically enhancing the test workflow's ability to manage GitHub resources during test cleanup.

  • Centralizes the testing repository configuration using an environment variable
  • Adds automatic branch deletion after closing pull requests during cleanup
  • Improves resource management by ensuring test branches are properly removed

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +118 to +119
echo "Deleting branch: $branch"
gh api -X DELETE "repos/${{ env.TESTING_REPOSITORY }}/git/refs/heads/$branch" || echo "Failed to delete branch: $branch"
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The branch deletion logic could potentially delete protected or important branches if the PR URL parsing fails or returns unexpected branch names. Consider adding validation to ensure only test-related branches are deleted, such as checking for a specific prefix pattern.

Suggested change
echo "Deleting branch: $branch"
gh api -X DELETE "repos/${{ env.TESTING_REPOSITORY }}/git/refs/heads/$branch" || echo "Failed to delete branch: $branch"
if [[ "$branch" == test-* || "$branch" == ci-* ]]; then
echo "Deleting branch: $branch"
gh api -X DELETE "repos/${{ env.TESTING_REPOSITORY }}/git/refs/heads/$branch" || echo "Failed to delete branch: $branch"
else
echo "Skipping deletion of non-test branch: $branch"
fi

Copilot uses AI. Check for mistakes.
@smockle smockle enabled auto-merge October 20, 2025 17:56
@smockle smockle merged commit a27c855 into v2 Oct 20, 2025
5 checks passed
@smockle smockle deleted the smockle/v2/backport-19 branch October 20, 2025 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants