From aa768a8a130e3b1bad67568398c0e9424db5a2e7 Mon Sep 17 00:00:00 2001 From: Ed Burns Date: Fri, 15 May 2026 17:17:17 -0700 Subject: [PATCH] Fix: Ensure dependencies label on PRs before codegen-agentic-fix pushes Fixes https://github.com/github/copilot-sdk-java/issues/199 The codegen-agentic-fix workflow's push-to-pull-request-branch safe-output requires the target PR to have the `dependencies` label. Two gaps allowed PRs to reach the agentic fix without this label: 1. update-copilot-dependency.yml: When the PR branch already exists from a prior run, the workflow reused it without adding the label. Now calls `gh pr edit --add-label dependencies` in that path. 2. codegen-check.yml: When triggering the agentic fix from any PR that touches codegen paths, the PR might not have the label (e.g., a manual PR or one created before the fix). Now ensures the label is present before dispatching codegen-agentic-fix.lock.yml. --- .github/workflows/codegen-check.yml | 3 +++ .github/workflows/update-copilot-dependency.yml | 1 + 2 files changed, 4 insertions(+) diff --git a/.github/workflows/codegen-check.yml b/.github/workflows/codegen-check.yml index b6f161d852..95e9365782 100644 --- a/.github/workflows/codegen-check.yml +++ b/.github/workflows/codegen-check.yml @@ -128,6 +128,9 @@ jobs: run: | ERROR_SUMMARY=$(cat /tmp/error-summary.txt) + # Ensure PR has dependencies label (required by codegen-agentic-fix safe-output) + gh pr edit "$PR_NUMBER" --add-label dependencies + gh workflow run codegen-agentic-fix.lock.yml \ -f branch="$BRANCH" \ -f pr_number="$PR_NUMBER" \ diff --git a/.github/workflows/update-copilot-dependency.yml b/.github/workflows/update-copilot-dependency.yml index 854661d5bd..d29da6acb7 100644 --- a/.github/workflows/update-copilot-dependency.yml +++ b/.github/workflows/update-copilot-dependency.yml @@ -147,6 +147,7 @@ jobs: if gh pr view "$BRANCH" >/dev/null 2>&1; then echo "Pull request for branch '$BRANCH' already exists; updated branch only." PR_NUMBER=$(gh pr view "$BRANCH" --json number --jq .number) + gh pr edit "$PR_NUMBER" --add-label dependencies else PR_NUMBER=$(gh pr create \ --title "Update @github/copilot to $VERSION" \