mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix issue-labeled.yml GH workflow (#67283)
This commit is contained in:
1
.github/teams.yml
vendored
1
.github/teams.yml
vendored
@@ -7,5 +7,4 @@ test:
|
|||||||
|
|
||||||
# Alerting team
|
# Alerting team
|
||||||
area/alerting:
|
area/alerting:
|
||||||
github-board: 52
|
|
||||||
channel-label: C02B9MXQE0J
|
channel-label: C02B9MXQE0J
|
||||||
|
|||||||
16
.github/workflows/issue-labeled.yml
vendored
16
.github/workflows/issue-labeled.yml
vendored
@@ -14,18 +14,12 @@ jobs:
|
|||||||
- name: "Determine which team to notify"
|
- name: "Determine which team to notify"
|
||||||
run: |
|
run: |
|
||||||
# Default to null values.
|
# Default to null values.
|
||||||
BOARD="null"
|
|
||||||
CHANNEL="null"
|
CHANNEL="null"
|
||||||
|
|
||||||
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))' teams.yml ) ]]; then
|
if [[ $(yq e 'keys | .[] | select(. == env(CURRENT_LABEL))' teams.yml ) ]]; then
|
||||||
# Check if we have a board set to use.
|
|
||||||
if [[ $(yq '.[env(CURRENT_LABEL)] | has("github-board")' teams.yml ) == true ]]; then
|
|
||||||
BOARD=$(yq '.[env(CURRENT_LABEL)].github-board' teams.yml)
|
|
||||||
echo "Ready to add issue to Grafana board ${BOARD}"
|
|
||||||
fi
|
|
||||||
# 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")' teams.yml ) == true ]]; then
|
if [[ $(yq '.[env(CURRENT_LABEL)] | has("channel-label")' teams.yml ) == true ]]; then
|
||||||
CHANNEL=$(yq '.[env(CURRENT_LABEL)].channel-label' teams.yml)
|
CHANNEL=$(yq '.[env(CURRENT_LABEL)].channel-label' teams.yml)
|
||||||
@@ -34,18 +28,8 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# set environment for next step
|
# set environment for next step
|
||||||
echo "BOARD=${BOARD}" >> $GITHUB_ENV
|
|
||||||
echo "CHANNEL=${CHANNEL}" >> $GITHUB_ENV
|
echo "CHANNEL=${CHANNEL}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: "Add to GitHub board"
|
|
||||||
if: ${{ env.BOARD != 'null' }}
|
|
||||||
uses: leonsteinhaeuser/project-beta-automations@v2.1.0
|
|
||||||
with:
|
|
||||||
project_id: ${{ env.BOARD }}
|
|
||||||
organization: grafana
|
|
||||||
resource_node_id: ${{ github.event.issue.node_id }}
|
|
||||||
gh_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: "Prepare payload"
|
- name: "Prepare payload"
|
||||||
uses: frabert/replace-string-action@v2.0
|
uses: frabert/replace-string-action@v2.0
|
||||||
id: preparePayload
|
id: preparePayload
|
||||||
|
|||||||
Reference in New Issue
Block a user