Skip to content

Replace branch check with head check in PlatformIO workflow#355

Merged
JanPetterMG merged 1 commit intomainfrom
JanPetterMG-patch-1
Feb 12, 2026
Merged

Replace branch check with head check in PlatformIO workflow#355
JanPetterMG merged 1 commit intomainfrom
JanPetterMG-patch-1

Conversation

@JanPetterMG
Copy link
Contributor

@JanPetterMG JanPetterMG commented Feb 12, 2026

This pull request replaces the remote branch existence check with a direct GitHub API lookup for pull requests by head branch.

The previous implementation relied on git ls-remote to determine whether a branch existed. This caused unintended behavior where closing a PR and deleting its branch could result in a new PR being recreated during the next workflow run.

The updated logic checks whether a PR already exists (open or closed) for the generated head branch, ensuring fully idempotent behavior.

Key changes

  • Removed git ls-remote branch existence checks.
  • Added a github-script step that queries pull requests.
  • Updated conditional workflow logic to skip PR creation when a PR for the head branch already exists.
  • Ensured closed PRs prevent recreation of identical update PRs.
  • Eliminated dependency between branch lifecycle and PR lifecycle.

Impact

  • Prevents automatic recreation of PRs after manual closure and branch deletion.
  • Makes dependency update automation fully idempotent.
  • Improves correctness by operating at the PR abstraction level instead of raw git branches.
  • Reduces unnecessary branch churn and duplicate PR noise.
  • Scales efficiently by querying GitHub directly instead of enumerating all PRs.

@JanPetterMG JanPetterMG added this to the v2.2.1 milestone Feb 12, 2026
@JanPetterMG JanPetterMG added chore This issue or pull request is a maintenance task no-changelog Do not include in release notes labels Feb 12, 2026
@JanPetterMG JanPetterMG enabled auto-merge (squash) February 12, 2026 16:58
@JanPetterMG JanPetterMG merged commit d5303da into main Feb 12, 2026
199 checks passed
@JanPetterMG JanPetterMG deleted the JanPetterMG-patch-1 branch February 12, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore This issue or pull request is a maintenance task no-changelog Do not include in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant