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/pr-codeql-analysis-python.yml

48 lines
1.2 KiB

name: "CodeQL for PR / python"
on:
workflow_dispatch:
pull_request:
branches: [main]
paths:
- '**/*.py'
permissions:
security-events: write
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
if: github.repository == 'grafana/grafana'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
persist-credentials: false
- name: Check for Python files
id: check-python
run: |
if [ -z "$(find . -name '*.py' -type f)" ]; then
echo "No Python files found, skipping analysis"
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "Python files found, proceeding with analysis"
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
if: steps.check-python.outputs.skip != 'true'
uses: github/codeql-action/init@v3
with:
languages: "python"
- name: Perform CodeQL Analysis
if: steps.check-python.outputs.skip != 'true'
uses: github/codeql-action/analyze@v3