The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/.github/workflows/commands.yml

70 lines
2.2 KiB

name: Run commands when issues are labeled or comments added
# important: this workflow uses a github app that is strictly limited
# to issues. If you want to change the triggers for this workflow,
# please review if the permissions are still sufficient.
on:
issues:
types: [labeled, unlabeled]
issue_comment:
types: [created]
concurrency:
group: issue-commands-${{ github.event.issue.number }}
permissions: {}
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 [ "${{ github.repository }}" == "grafana/grafana" ] && [ -n "${{ secrets.GRAFANA_MISC_STATS_API_KEY }}" ]; then
echo "has-secrets=1" >> "$GITHUB_OUTPUT"
fi
main:
needs: config
if: needs.config.outputs.has-secrets
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: "Get vault secrets"
id: vault-secrets
uses: grafana/shared-workflows/actions/get-vault-secrets@main # zizmor: ignore[unpinned-uses]
with:
# Secrets placed in the ci/repo/grafana/grafana/plugins_platform_issue_commands_github_bot path in Vault
repo_secrets: |
GH_APP_ID=plugins_platform_issue_commands_github_bot:app_id
GH_APP_PEM=plugins_platform_issue_commands_github_bot:app_pem
- name: "Generate token"
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ env.GH_APP_ID }}
private_key: ${{ env.GH_APP_PEM }}
- name: Checkout Actions
uses: actions/checkout@v4 # v4.2.2
with:
repository: "grafana/grafana-github-actions"
path: ./actions
ref: main
persist-credentials: false
- name: Install Actions
run: npm install --production --prefix ./actions
- name: Run Commands
uses: ./actions/commands
with:
metricsWriteAPIKey: ${{secrets.GRAFANA_MISC_STATS_API_KEY}}
token: ${{ steps.generate_token.outputs.token }}
configPath: commands