| 1 |
#!/usr/bin/env bash |
| 2 |
# |
| 3 |
# Copyright The OpenTelemetry Authors |
| 4 |
# SPDX-License-Identifier: Apache-2.0 |
| 5 |
# |
| 6 |
# |
| 7 |
|
| 8 |
set -euo pipefail |
| 9 |
|
| 10 |
if [[ -z "${COMPONENT:-}" || -z "${ISSUE:-}" ]]; then |
| 11 |
echo "Either COMPONENT or ISSUE has not been set, please ensure both are set." |
| 12 |
exit 0 |
| 13 |
fi |
| 14 |
|
| 15 |
CUR_DIRECTORY=$(dirname "$0") |
| 16 |
|
| 17 |
OWNERS=$(COMPONENT="${COMPONENT}" bash "${CUR_DIRECTORY}/get-codeowners.sh") |
| 18 |
|
| 19 |
if [[ -z "${OWNERS}" ]]; then |
| 20 |
exit 0 |
| 21 |
fi |
| 22 |
|
| 23 |
gh issue comment "${ISSUE}" --body "Pinging code owners for ${COMPONENT}: ${OWNERS}. See [Adding Labels via Comments](https://github.com/open-telemetry/opentelemetry-collector/blob/main/CONTRIBUTING.md#adding-labels-via-comments) if you do not have permissions to add labels yourself. For example, comment '/label priority:p2 -needs-triage' to set the priority and remove the needs-triage label." |