Label all new issues with `triage:needs-triage` label (#1767)

This commit is contained in:
Liudmila Molkova 2025-01-20 13:56:50 -08:00 committed by GitHub
parent 77f0b70d36
commit 0e109d2662
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 21 deletions

View File

@ -1,6 +1,6 @@
name: Bug report
description: Create a report to help us improve
labels: ["bug", "triage:needs-triage"]
labels: ["bug"]
body:
- type: markdown
attributes:

View File

@ -1,6 +1,6 @@
name: Propose changes to existing conventions
description: Propose changes you'd like to be added to existing conventions
labels: ["enhancement", "triage:needs-triage"]
labels: ["enhancement"]
body:
- type: dropdown
id: area

View File

@ -1,6 +1,6 @@
name: Propose new semantic conventions
description: Propose new conventions you'd like to be part of the OpenTelemetry project
labels: ["enhancement", "triage:needs-triage", "experts needed"]
labels: ["enhancement", "experts needed"]
body:
- type: markdown
attributes:

View File

@ -28,7 +28,7 @@ if [[ -z "${ISSUE:-}" || -z "${BODY:-}" || -z "${OPENER:-}" ]]; then
exit 0
fi
LABELS=""
LABELS="triage:needs-triage"
AREAS_SECTION_START=$( (echo "${BODY}" | grep -n '### Area(s)' | awk '{ print $1 }' | grep -oE '[0-9]+') || echo '-1' )
BODY_AREAS=""
@ -45,26 +45,19 @@ for AREA in ${BODY_AREAS}; do
continue
fi
if [[ -n "${LABELS}" ]]; then
LABELS+=","
fi
LABELS+="${AREA}"
LABELS+=",${AREA}"
done
if [[ -v PINGED_AREAS[@] ]]; then
echo "The issue was associated with areas:" "${!PINGED_AREAS[@]}"
if [[ -v BODY_AREAS[@] ]]; then
echo "The issue was associated with areas:" "${!BODY_AREAS[@]}"
else
echo "No related areas were given"
fi
if [[ -n "${LABELS}" ]]; then
# Notes on this call:
# 1. Labels will be deduplicated by the GitHub CLI.
# 2. The call to edit the issue will fail if any of the
# labels doesn't exist. We can be reasonably sure that
# all labels will exist since they come from a known set.
echo "Adding the following labels: ${LABELS//,/ /}"
gh issue edit "${ISSUE}" --add-label "${LABELS}" || true
else
echo "No labels were found to add"
fi
# Notes on this call:
# 1. Labels will be deduplicated by the GitHub CLI.
# 2. The call to edit the issue will fail if any of the
# labels doesn't exist. We can be reasonably sure that
# all labels will exist since they come from a known set.
echo "Adding the following labels: ${LABELS//,/ /}"
gh issue edit "${ISSUE}" --add-label "${LABELS}" || true