mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Remove issue-labeled.yml GitHub workflow (#95611)
This was previously used for the Alerting squad but isn't anymore.
This commit is contained in:
parent
9349a59c48
commit
98178fba68
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@ -700,7 +700,6 @@ embed.go @grafana/grafana-as-code
|
||||
/.github/pr-checks.json @tolzhabayev
|
||||
/.github/pr-commands.json @tolzhabayev
|
||||
/.github/renovate.json5 @grafana/frontend-ops
|
||||
/.github/teams.yml @armandgrillet
|
||||
/.github/workflows/alerting-swagger-gen.yml @grafana/alerting-backend
|
||||
/.github/workflows/auto-milestone.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/backport.yml @grafana/grafana-developer-enablement-squad
|
||||
@ -717,7 +716,6 @@ embed.go @grafana/grafana-as-code
|
||||
/.github/workflows/deploy-pr-preview.yml @grafana/docs-tooling
|
||||
/.github/workflows/epic-add-to-platform-ux-parent-project.yml @meanmina
|
||||
/.github/workflows/github-release.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/issue-labeled.yml @armandgrillet
|
||||
/.github/workflows/issue-opened.yml @grafana/grafana-community-support
|
||||
/.github/workflows/metrics-collector.yml @torkelo
|
||||
/.github/workflows/milestone.yml @tolzhabayev
|
||||
|
104
.github/teams.yml
vendored
104
.github/teams.yml
vendored
@ -1,104 +0,0 @@
|
||||
# The first keys are labels used on issues. All fields are optional.
|
||||
# Example
|
||||
test:
|
||||
# channel-label is used to send a message to a specific channel
|
||||
# when the label "test" is added to an issue.
|
||||
channel-label: CXXXXXXXXXX
|
||||
|
||||
# Alerting team
|
||||
area/alerting:
|
||||
channel-label: C028MCV4R7C
|
||||
exclude-github-team: alerting-squad
|
||||
|
||||
# DataViz squad
|
||||
area/dataviz:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/legend:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/panel/barchart:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/panel/bargauge:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/panel/candlestick:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/panel/canvas:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/panel/common:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/panel/gauge:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/panel/geomap:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/panel/graph:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/panel/heatmap:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/panel/histogram:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/panel/piechart:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/panel/stat:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/panel/state-timeline:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/panel/status-history:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/panel/timeseries:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/panel/trend:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/panel/xychart:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/tooltip:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/transformations:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/value-mapping:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
||||
|
||||
area/units:
|
||||
channel-label: C04J73AAQ87 # grafana-dataviz
|
||||
exclude-github-team: dataviz-squad
|
99
.github/workflows/issue-labeled.yml
vendored
99
.github/workflows/issue-labeled.yml
vendored
@ -1,99 +0,0 @@
|
||||
name: Notify Slack channel based on new issue label
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [labeled]
|
||||
|
||||
jobs:
|
||||
config:
|
||||
runs-on: "ubuntu-latest"
|
||||
outputs:
|
||||
has-secrets: ${{ steps.check.outputs.has-secrets }}
|
||||
steps:
|
||||
- name: "Check for secrets"
|
||||
id: check
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -n "${{ (secrets.SLACK_WEBHOOK_URL != '') || '' }}" ]; then
|
||||
echo "has-secrets=1" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
notify:
|
||||
needs: config
|
||||
if: needs.config.outputs.has-secrets
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- 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: |
|
||||
# Default to null values.
|
||||
CHANNEL="null"
|
||||
TEAM="null"
|
||||
|
||||
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))' teams.yml ) ]]; then
|
||||
# Check if we have a channel set to notify on comments.
|
||||
if [[ $(yq '.[env(CURRENT_LABEL)] | has("channel-label")' teams.yml ) == true ]]; then
|
||||
CHANNEL=$(yq '.[env(CURRENT_LABEL)].channel-label' teams.yml)
|
||||
echo "Ready to send issue to channel ID ${CHANNEL}"
|
||||
fi
|
||||
|
||||
if [[ $(yq '.[env(CURRENT_LABEL)] | has("exclude-github-team")' teams.yml ) == true ]]; then
|
||||
TEAM=$(yq '.[env(CURRENT_LABEL)].exclude-github-team' teams.yml)
|
||||
echo "Will not send issue to channel if issue author is part of the team ${TEAM}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# set environment for next steps
|
||||
echo "CHANNEL=${CHANNEL}" >> "$GITHUB_ENV"
|
||||
echo "TEAM=${TEAM}" >> "$GITHUB_ENV"
|
||||
|
||||
- name: "Prepare payload"
|
||||
uses: frabert/replace-string-action@v2.5
|
||||
id: preparePayload
|
||||
with:
|
||||
# replace double quotes with single quotes to avoid breaking the JSON payload sent to Slack
|
||||
string: ${{ github.event.issue.title }}
|
||||
pattern: '"'
|
||||
replace-with: "'"
|
||||
flags: 'g'
|
||||
|
||||
- name: Get Token
|
||||
id: get_workflow_token
|
||||
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
|
||||
with:
|
||||
app_id: ${{ secrets.APP_GRAFANA_TEAM_CHECKER_ID }}
|
||||
private_key: ${{ secrets.APP_GRAFANA_TEAM_CHECKER_KEY }}
|
||||
|
||||
- name: "Check that issue author is not part of the team"
|
||||
if: ${{ env.TEAM != 'null' }}
|
||||
run: |
|
||||
response=$(gh api /orgs/grafana/teams/${{ env.TEAM }}/memberships/${{ github.event.issue.user.login }} -i -H "Accept: application/vnd.github.v3+json")
|
||||
STATUS_CODE=$(echo "$response" | head -n 1 | cut -d' ' -f2)
|
||||
if [ "$STATUS_CODE" -eq "404" ]; then
|
||||
echo "The user was not found in the team."
|
||||
echo "USER_FOUND=false" >> "$GITHUB_ENV"
|
||||
else
|
||||
echo "The user was potentially found in the team"
|
||||
echo "USER_FOUND=maybe" >> "$GITHUB_ENV"
|
||||
fi
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
|
||||
|
||||
- name: "Send Slack notification"
|
||||
if: ${{ (env.CHANNEL != 'null') && ((env.USER_FOUND == 'false') || (env.TEAM != 'null')) }}
|
||||
uses: slackapi/slack-github-action@v1.26.0
|
||||
with:
|
||||
payload: >
|
||||
{
|
||||
"icon_emoji": ":grafana:",
|
||||
"username": "Grafana issue labeled",
|
||||
"text": "Issue \"${{ steps.preparePayload.outputs.replaced }}\" labeled \"${{ github.event.label.name }}\": ${{ github.event.issue.html_url }}, please triage.",
|
||||
"channel": "${{ env.CHANNEL }}"
|
||||
}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
Loading…
Reference in New Issue
Block a user