From e935ba2954c7772bc21f942a942d4f7ae6c8cd6a Mon Sep 17 00:00:00 2001 From: Armand Grillet <2117580+armandgrillet@users.noreply.github.com> Date: Thu, 23 Jun 2022 12:31:33 +0200 Subject: [PATCH] Improve issue-labeled.yml workflow (#51308) Instead of downloading the entire grafana/grafana repository, the workflow now simply fetches the file containing the map of labels and teams. This change makes the workflow much faster. --- .github/workflows/issue-labeled.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index 048471bcebf..722e5abb7c2 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -8,8 +8,8 @@ jobs: notify: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: "Download teams.yml to know which label is for which team" + run: wget https://raw.githubusercontent.com/grafana/grafana/main/.github/teams.yml - name: "Determine which team to notify" run: | @@ -19,10 +19,10 @@ jobs: echo "${{ github.event.label.name }} label added" export CURRENT_LABEL="${{ github.event.label.name }}" # Enable the use of the label in yq evaluations # yq is installed by default in ubuntu-latest - if [[ $(yq e 'keys | .[] | select(. == env(CURRENT_LABEL))' .github/teams.yml ) ]]; then + if [[ $(yq e 'keys | .[] | select(. == env(CURRENT_LABEL))' teams.yml ) ]]; then # Check if we have a channel set to notify on comments. - if [[ $(yq '.[env(CURRENT_LABEL)] | has("channel-label")' .github/teams.yml ) == true ]]; then - CHANNEL=$(yq '.[env(CURRENT_LABEL)].channel-label' .github/teams.yml) + if [[ $(yq '.[env(CURRENT_LABEL)] | has("channel-label")' teams.yml ) == true ]]; then + CHANNEL=$(yq '.[env(CURRENT_LABEL)].channel-label' teams.yml) fi fi