mirror of
https://github.com/grafana/grafana.git
synced 2024-11-22 08:56:43 -06:00
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.
This commit is contained in:
parent
81dc9ef725
commit
e935ba2954
10
.github/workflows/issue-labeled.yml
vendored
10
.github/workflows/issue-labeled.yml
vendored
@ -8,8 +8,8 @@ jobs:
|
|||||||
notify:
|
notify:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: "Download teams.yml to know which label is for which team"
|
||||||
uses: actions/checkout@v3
|
run: wget https://raw.githubusercontent.com/grafana/grafana/main/.github/teams.yml
|
||||||
|
|
||||||
- name: "Determine which team to notify"
|
- name: "Determine which team to notify"
|
||||||
run: |
|
run: |
|
||||||
@ -19,10 +19,10 @@ jobs:
|
|||||||
echo "${{ github.event.label.name }} label added"
|
echo "${{ github.event.label.name }} label added"
|
||||||
export CURRENT_LABEL="${{ github.event.label.name }}" # Enable the use of the label in yq evaluations
|
export CURRENT_LABEL="${{ github.event.label.name }}" # Enable the use of the label in yq evaluations
|
||||||
# yq is installed by default in ubuntu-latest
|
# 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.
|
# Check if we have a channel set to notify on comments.
|
||||||
if [[ $(yq '.[env(CURRENT_LABEL)] | has("channel-label")' .github/teams.yml ) == true ]]; then
|
if [[ $(yq '.[env(CURRENT_LABEL)] | has("channel-label")' teams.yml ) == true ]]; then
|
||||||
CHANNEL=$(yq '.[env(CURRENT_LABEL)].channel-label' .github/teams.yml)
|
CHANNEL=$(yq '.[env(CURRENT_LABEL)].channel-label' teams.yml)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user