Skip to content

Commit 4749b79

Browse files
abidhasan-awsmergify[bot]
authored andcommitted
fix auto enum updater bug
1 parent aae21e2 commit 4749b79

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)