Skip to content

Commit 67ef21f

Browse files
ci(auto-enum-updater): replacing searching for pr with head and base instead of title (#35886)
### Reason for this change The Auto Enum Updater action is failing because it attempts to create a new PR when there's already an existing PR with identical changes. The workflow should handle this scenario by closing the existing PR and creating a new one, but this functionality appears to be broken. - Failed Job URL: https://github.com/aws/aws-cdk/actions/runs/18874502066/job/53878253437 - Workflow: `.github/workflows/enum-auto-updater.yml` The issue is that when the workflow trying to find existing pr with `--search $}{tittle}`, it's not working. ### Description of changes Instead of listing the existing pr using `--search`, this change lists the pr using `--base` and `--head`. ### Description of how you validated changes The workflow has been tested in fork. - Job: https://github.com/abidhasan-aws/aws-cdk/actions/runs/18906468702/job/53965818347 ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent aae21e2 commit 67ef21f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/enum-auto-updater.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,12 @@ jobs:
7979
echo "ERROR: Cannot find module directory for $module"
8080
continue
8181
fi
82-
82+
83+
# Branch name for the module
84+
branchName="enum-update/${moduleName#aws-}"
85+
8386
# Check for existing PR with the same name
84-
prExists=$(gh pr list --state open --search "chore(${moduleName#aws-}): add new enum values for ${moduleName#aws-}" --json number,title -q '.[].number')
87+
prExists=$(gh pr list --state open --head ${branchName} --base main --json number,title -q '.[].number')
8588

8689
# If a PR exists, close it
8790
if [[ -n "$prExists" ]]; then
@@ -92,7 +95,6 @@ jobs:
9295
fi
9396

9497
# Create/switch to branch for the module
95-
branchName="enum-update/${moduleName#aws-}"
9698
echo "Creating/switching to branch: $branchName"
9799
git checkout -B "$branchName" $original_branch # -B forces branch creation/reset
98100

0 commit comments

Comments
 (0)