Skip to content

Commit 3bac178

Browse files
committed
Fix PR finding spacing issue
Review comment from Copilot: - #2113 (comment) - #2113 (comment) Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
1 parent 72343f4 commit 3bac178

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

.github/workflows/pr-kind-label.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ jobs:
2727
done
2828
2929
# Extract /kind values from PR body and apply labels
30-
printf '%s' "$PR_BODY" | tr -d '\r' | grep '^/kind ' | \
31-
sed 's|^/kind ||' | sort -u | \
30+
printf '%s' "$PR_BODY" | tr -d '\r' | sed -n 's|^/kind[[:space:]][[:space:]]*||p' | sed 's|[[:space:]]*$||' | sort -u | \
3231
while IFS= read -r kind; do
3332
[ -z "$kind" ] && continue
3433
gh pr edit "$PR_NUMBER" --repo "$REPO" --add-label "kind/$kind" || \
@@ -65,8 +64,8 @@ jobs:
6564
REPO: ${{ github.repository }}
6665
run: |
6766
# Use the last /milestone directive in the PR body
68-
milestone=$(printf '%s' "$PR_BODY" | tr -d '\r' | sed -n 's|^/milestone ||p' | \
69-
tail -n 1)
67+
milestone=$(printf '%s' "$PR_BODY" | tr -d '\r' | sed -n 's|^/milestone[[:space:]][[:space:]]*||p' | \
68+
sed 's|[[:space:]]*$||' | tail -n 1)
7069
[ -z "$milestone" ] && exit 0
7170
gh pr edit "$PR_NUMBER" --repo "$REPO" --milestone "$milestone" || \
7271
echo "::warning::Milestone '$milestone' not found in repository"

0 commit comments

Comments
 (0)