Fix auto labelling for release labels (#25249)
Closes #25248 Signed-off-by: stianst <stianst@gmail.com>
This commit is contained in:
parent
79fa85a4e9
commit
02857a065d
2 changed files with 5 additions and 5 deletions
8
.github/scripts/pr-find-issues.sh
vendored
8
.github/scripts/pr-find-issues.sh
vendored
|
@ -8,18 +8,17 @@ if [ "$REPO" == "" ]; then
|
|||
fi
|
||||
|
||||
function parse_issues() {
|
||||
echo "$1" | grep -i -P -o "(close|closes|closed|resolve|resolves|resolved) #[[:digit:]]*" | cut -d '#' -f 2 | sort -n
|
||||
echo "$1" | grep -i -P -o "(close|closes|closed|resolve|resolves|resolved) https://github.com/$REPO/issues/[[:digit:]]*" | cut -d '/' -f 7 | sort -n
|
||||
}
|
||||
|
||||
PR_JSON=$(gh api "/repos/$REPO/pulls/$PR")
|
||||
|
||||
PR_BODY=$(echo "$PR_JSON" | jq .body)
|
||||
PR_BODY=$(echo "$PR_JSON" | jq -r .body)
|
||||
PR_MERGE_COMMIT_SHA=$(echo "$PR_JSON" | jq -r .merge_commit_sha)
|
||||
|
||||
ISSUES=$(parse_issues "$PR_BODY")
|
||||
if [ "$ISSUES" == "" ]; then
|
||||
COMMIT_JSON=$(gh api "/repos/$REPO/commits/$PR_MERGE_COMMIT_SHA")
|
||||
COMMIT_MESSAGE=$(echo "$COMMIT_JSON" | jq .commit.message)
|
||||
COMMIT_MESSAGE=$(echo "$COMMIT_JSON" | jq -r .commit.message)
|
||||
|
||||
ISSUES=$(parse_issues "$COMMIT_MESSAGE")
|
||||
fi
|
||||
|
@ -27,3 +26,4 @@ fi
|
|||
for i in $ISSUES; do
|
||||
echo "$i"
|
||||
done
|
||||
|
||||
|
|
2
.github/workflows/label.yml
vendored
2
.github/workflows/label.yml
vendored
|
@ -1,4 +1,4 @@
|
|||
name: Labeler
|
||||
name: Labeller
|
||||
on:
|
||||
pull_request_target:
|
||||
types: closed
|
||||
|
|
Loading…
Reference in a new issue