Skip to content

Commit 75bb5e2

Browse files
jamietannaClaude Sonnet 4.5
andauthored
ci(find-issues-with-missing-labels): note author of issues (#41228)
* chore: remove trailing whitespace * ci(find-issues-with-missing-labels): note author of issues As a way at-a-glance to see if it's something a maintainer/contributor has forgotten, or if it's an externally raised issue that shouldn't be. Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io> --------- Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io>
1 parent 20c9133 commit 75bb5e2

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

tools/find-issues-with-missing-labels.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ ISSUE_TITLE="Issues with missing labels"
1919
LABEL_TYPE=$(echo "$PRIORITY_LABELS_FILTER" | cut -d ':' -f 2 | cut -d '-' -f 1)
2020

2121
# Fetch issues that match the filter
22-
ISSUES_MISSING_LABEL=$(gh issue list --repo $REPO --limit 100000 -s open -S "$PRIORITY_LABELS_FILTER" --json "number,title") || { echo "Failed to fetch issues without $LABEL_TYPE labels"; exit 1; }
22+
ISSUES_MISSING_LABEL=$(gh issue list --repo $REPO --limit 100000 -s open -S "$PRIORITY_LABELS_FILTER" --json "number,title,author") || { echo "Failed to fetch issues without $LABEL_TYPE labels"; exit 1; }
2323
# Ignore the Issue from the "Find issues with missing labels" Action
2424
ISSUES_MISSING_LABEL=$(echo "$ISSUES_MISSING_LABEL" | jq --arg title "$ISSUE_TITLE" 'map(select(.title != $title))')
2525

2626
if [ "$ISSUES_MISSING_LABEL" != "[]" ]; then
2727
HAS_ISSUES_MISSING_LABELS=true
28-
29-
# Create a list of issue numbers
30-
FORMATTED_OUTPUT=$(echo "$ISSUES_MISSING_LABEL" | jq -r '.[].number' | sed 's/^/- https:\/\/redirect.github.com\/renovatebot\/renovate\/issues\//')
31-
28+
29+
# Create a list of issue numbers with authors
30+
FORMATTED_OUTPUT=$(echo "$ISSUES_MISSING_LABEL" | jq -r '.[] | "- https://redirect.github.com/renovatebot/renovate/issues/\(.number) (by `\(.author.login)`)"')
31+
3232
# Count the issues and decide if the output should be singular or plural
3333
ISSUE_COUNT=$(echo "$ISSUES_MISSING_LABEL" | jq '. | length')
3434
ISSUE_SINGULAR_PLURAL=$(if [ "$ISSUE_COUNT" -eq 1 ]; then echo "issue"; else echo "issues"; fi)
35-
35+
3636
# Append the "list of issues without labels" to the issue body
3737
ISSUE_BODY="$ISSUE_BODY## Found $ISSUE_COUNT $ISSUE_SINGULAR_PLURAL missing \`$LABEL_TYPE:\` labels:\n$FORMATTED_OUTPUT\n"
3838
fi
@@ -41,20 +41,20 @@ fi
4141
LABEL_TYPE=$(echo "$ISSUE_TYPE_FILTER" | cut -d ':' -f 2)
4242

4343
# Fetch issues that match the filter
44-
ISSUES_MISSING_TYPE=$(gh issue list --repo $REPO --limit 100000 -s open -S "$ISSUE_TYPE_FILTER" --json "number,title") || { echo "Failed to fetch issues without $LABEL_TYPE"; exit 1; }
44+
ISSUES_MISSING_TYPE=$(gh issue list --repo $REPO --limit 100000 -s open -S "$ISSUE_TYPE_FILTER" --json "number,title,author") || { echo "Failed to fetch issues without $LABEL_TYPE"; exit 1; }
4545
# Ignore the Issue from the "Find issues with missing labels" Action
4646
ISSUES_MISSING_TYPE=$(echo "$ISSUES_MISSING_TYPE" | jq --arg title "$ISSUE_TITLE" 'map(select(.title != $title))')
4747

4848
if [ "$ISSUES_MISSING_TYPE" != "[]" ]; then
4949
HAS_ISSUES_MISSING_ISSUE_TYPE=true
50-
51-
# Create a list of issue numbers
52-
FORMATTED_OUTPUT=$(echo "$ISSUES_MISSING_TYPE" | jq -r '.[].number' | sed 's/^/- https:\/\/redirect.github.com\/renovatebot\/renovate\/issues\//')
53-
50+
51+
# Create a list of issue numbers with authors
52+
FORMATTED_OUTPUT=$(echo "$ISSUES_MISSING_TYPE" | jq -r '.[] | "- https://redirect.github.com/renovatebot/renovate/issues/\(.number) (by `\(.author.login)`)"')
53+
5454
# Count the issues and decide if the output should be singular or plural
5555
ISSUE_COUNT=$(echo "$ISSUES_MISSING_TYPE" | jq '. | length')
5656
ISSUE_SINGULAR_PLURAL=$(if [ "$ISSUE_COUNT" -eq 1 ]; then echo "issue"; else echo "issues"; fi)
57-
57+
5858
# Append the "list of issues without issye type" to the issue body
5959
ISSUE_BODY="$ISSUE_BODY## Found $ISSUE_COUNT $ISSUE_SINGULAR_PLURAL missing issue type:\n$FORMATTED_OUTPUT\n"
6060
fi

0 commit comments

Comments
 (0)