From 79e01f408fc59b91458fef1a3d1a4704b8ba7d30 Mon Sep 17 00:00:00 2001 From: Curtis Robert Date: Tue, 19 Dec 2023 15:20:38 -0800 Subject: [PATCH] [chore][CI/CD] Ping code owners even if one applies label Currently if a label is applied by a code owner of the label's component, we don't ping the components code owners. This makes sense in the most simple case of one code owner (mostly), but is less effective for multiple code owners, as the other owners will not be pinged for relevant issues. Also, applying a label does not subscribe GitHub users to issues, so without a ping, the person applying a label also won't receive notifications on issue updates. --- .github/workflows/ping-codeowners-issues.yml | 1 - .github/workflows/scripts/ping-codeowners-issues.sh | 9 ++------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ping-codeowners-issues.yml b/.github/workflows/ping-codeowners-issues.yml index 6f4162b5a296..9a58d23f1f69 100644 --- a/.github/workflows/ping-codeowners-issues.yml +++ b/.github/workflows/ping-codeowners-issues.yml @@ -16,4 +16,3 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ISSUE: ${{ github.event.issue.number }} COMPONENT: ${{ github.event.label.name }} - SENDER: ${{ github.event.sender.login }} diff --git a/.github/workflows/scripts/ping-codeowners-issues.sh b/.github/workflows/scripts/ping-codeowners-issues.sh index cce1d37dbe18..a9ce7a875cbe 100755 --- a/.github/workflows/scripts/ping-codeowners-issues.sh +++ b/.github/workflows/scripts/ping-codeowners-issues.sh @@ -7,8 +7,8 @@ set -euo pipefail -if [[ -z "${COMPONENT:-}" || -z "${ISSUE:-}" || -z "${SENDER:-}" ]]; then - echo "At least one of COMPONENT, ISSUE, or SENDER has not been set, please ensure each is set." +if [[ -z "${COMPONENT:-}" || -z "${ISSUE:-}" ]]; then + echo "Either COMPONENT or ISSUE has not been set, please ensure both are set." exit 0 fi @@ -20,9 +20,4 @@ if [[ -z "${OWNERS}" ]]; then exit 0 fi -if [[ "${OWNERS}" =~ "${SENDER}" ]]; then - echo "Label applied by code owner ${SENDER}" - exit 0 -fi - gh issue comment "${ISSUE}" --body "Pinging code owners for ${COMPONENT}: ${OWNERS}. See [Adding Labels via Comments](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#adding-labels-via-comments) if you do not have permissions to add labels yourself."