diff --git a/.github/pr-commands.json b/.github/pr-commands.json new file mode 100644 index 00000000000..d2f7b99ffb2 --- /dev/null +++ b/.github/pr-commands.json @@ -0,0 +1,169 @@ +[ + { + "type": "changedfiles", + "matches": [ + "/docs/", + "/contribute/" + ], + "action": "updateLabel", + "addLabel": "type/docs" + }, + { + "type": "changedfiles", + "matches": [ + "/public", + "/packages", + "/e2e", + "/plugins-bundled", + "/scripts/build/release-packages.sh", + "/scripts/circle-release-next-packages.sh", + "/scripts/ci-frontend-metrics.sh", + "/scripts/grunt", + "/scripts/webpack", + "package.json", + "tsconfig.json", + "lerna.json", + ".babelrc", + ".prettierrc.js", + ".eslintrc", + "*.mdx" + ], + "action": "updateLabel", + "addLabel": "area/frontend" + }, + { + "type": "changedfiles", + "matches": [ + "*.go", + "go.mod", + "go.sum", + "/contribute/style-guides/backend.md", + "/contribute/architecture/backend", + "/scripts/go/" + ], + "action": "updateLabel", + "addLabel": "area/backend" + }, + { + "type": "changedfiles", + "matches": [ + "/pkg/services/sqlstore/migrations", + "*_mig.go" + ], + "action": "updateLabel", + "addLabel": "area/backend/db/migration" + }, + { + "type": "changedfiles", + "matches": [ "/public/app/features/explore"], + "action": "updateLabel", + "addLabel": "area/explore" + }, + { + "type": "changedfiles", + "matches": [ + "/.circleci", + "/packaging", + "/scripts/build", + "/scripts/*.sh", + "/scripts/*.star", + "/.drone.star", + "/.drone.yml", + "/Makefile", + "/Dockerfile", + "/Dockerfile.ubuntu" + ], + "action": "updateLabel", + "addLabel": "type/build-packaging" + }, + { + "type": "changedfiles", + "matches": [ "/public/app/plugins/datasource/grafana-azure-monitor-datasource", "/pkg/tsdb/azuremonitor"], + "action": "updateLabel", + "addLabel": "datasource/Azure" + }, + { + "type": "changedfiles", + "matches": [ "/public/app/plugins/datasource/cloud-monitoring", "/pkg/tsdb/cloudmonitoring"], + "action": "updateLabel", + "addLabel": "datasource/GoogleCloudMonitoring" + }, + { + "type": "changedfiles", + "matches": [ "/public/app/plugins/datasource/cloudwatch", "/pkg/tsdb/cloudwatch"], + "action": "updateLabel", + "addLabel": "datasource/CloudWatch" + }, + { + "type": "changedfiles", + "matches": [ "/public/app/plugins/datasource/elasticsearch", "/pkg/tsdb/elasticsearch"], + "action": "updateLabel", + "addLabel": "datasource/Prometheus" + }, + { + "type": "changedfiles", + "matches": [ "/public/app/plugins/datasource/graphite", "/pkg/tsdb/graphite"], + "action": "updateLabel", + "addLabel": "datasource/Graphite" + }, + { + "type": "changedfiles", + "matches": [ "/public/app/plugins/datasource/influxdb", "/pkg/tsdb/influx"], + "action": "updateLabel", + "addLabel": "datasource/InfluxDB" + }, + { + "type": "changedfiles", + "matches": [ "/public/app/plugins/datasource/jaeger"], + "action": "updateLabel", + "addLabel": "datasource/Jaeger" + }, + { + "type": "changedfiles", + "matches": [ "/public/app/plugins/datasource/loki", "/pkg/tsdb/loki"], + "action": "updateLabel", + "addLabel": "datasource/Loki" + }, + { + "type": "changedfiles", + "matches": [ "/public/app/plugins/datasource/mssql", "/pkg/tsdb/mssql"], + "action": "updateLabel", + "addLabel": "datasource/MSSQL" + }, + { + "type": "changedfiles", + "matches": [ "/public/app/plugins/datasource/mysql", "/pkg/tsdb/mysql"], + "action": "updateLabel", + "addLabel": "datasource/MySQL" + }, + { + "type": "changedfiles", + "matches": [ "/public/app/plugins/datasource/opentsdb", "/pkg/tsdb/opentsdb"], + "action": "updateLabel", + "addLabel": "datasource/OpenTSDB" + }, + { + "type": "changedfiles", + "matches": [ "/public/app/plugins/datasource/postgres", "/pkg/tsdb/postgres"], + "action": "updateLabel", + "addLabel": "datasource/Postgres" + }, + { + "type": "changedfiles", + "matches": [ "/public/app/plugins/datasource/prometheus", "/pkg/tsdb/prometheus"], + "action": "updateLabel", + "addLabel": "datasource/Prometheus" + }, + { + "type": "changedfiles", + "matches": [ "/public/app/plugins/datasource/tempo", "/pkg/tsdb/tempo"], + "action": "updateLabel", + "addLabel": "datasource/Tempo" + }, + { + "type": "changedfiles", + "matches": [ "/public/app/plugins/datasource/zipkin"], + "action": "updateLabel", + "addLabel": "datasource/Zipkin" + } +] \ No newline at end of file diff --git a/.github/workflows/pr-commands.yml b/.github/workflows/pr-commands.yml new file mode 100644 index 00000000000..cd115987f6c --- /dev/null +++ b/.github/workflows/pr-commands.yml @@ -0,0 +1,25 @@ +name: PR automation +on: + pull_request_target: + types: + - opened + - synchronize + +jobs: + main: + runs-on: ubuntu-latest + steps: + - name: Checkout Actions + uses: actions/checkout@v2 + with: + repository: "grafana/grafana-github-actions" + path: ./actions + ref: main + - name: Install Actions + run: npm install --production --prefix ./actions + - name: Run Commands + uses: ./actions/commands + with: + metricsWriteAPIKey: ${{secrets.GRAFANA_MISC_STATS_API_KEY}} + token: ${{secrets.GH_BOT_ACCESS_TOKEN}} + configPath: pr-commands