2020-10-09 13:43:41 -05:00
|
|
|
#
|
|
|
|
# When triggered by the cron job it will also collect metrics for:
|
|
|
|
# * number of issues without label
|
|
|
|
# * number of issues with "needs more info"
|
|
|
|
# * number of issues with "needs investigation"
|
|
|
|
# * number of issues with label type/bug
|
|
|
|
# * number of open issues in current milestone
|
|
|
|
#
|
|
|
|
# https://github.com/grafana/grafana-github-actions/blob/main/metrics-collector/index.ts
|
|
|
|
#
|
2020-10-26 13:43:58 -05:00
|
|
|
name: Github issue metrics collection
|
2020-10-09 08:20:04 -05:00
|
|
|
on:
|
2020-10-09 13:53:54 -05:00
|
|
|
schedule:
|
|
|
|
- cron: "*/10 * * * *"
|
2020-10-09 08:20:04 -05:00
|
|
|
issues:
|
|
|
|
types: [opened, closed]
|
|
|
|
|
|
|
|
jobs:
|
2023-08-02 06:25:23 -05:00
|
|
|
config:
|
|
|
|
runs-on: "ubuntu-latest"
|
|
|
|
outputs:
|
|
|
|
has-secrets: ${{ steps.check.outputs.has-secrets }}
|
|
|
|
steps:
|
|
|
|
- name: "Check for secrets"
|
|
|
|
id: check
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2024-01-18 09:29:40 -06:00
|
|
|
if [ -n "${{ (secrets.GRAFANA_MISC_STATS_API_KEY != '') || '' }}" ]; then
|
2023-08-02 06:25:23 -05:00
|
|
|
echo "has-secrets=1" >> "$GITHUB_OUTPUT"
|
|
|
|
fi
|
|
|
|
|
2020-10-09 08:20:04 -05:00
|
|
|
main:
|
2023-08-02 06:25:23 -05:00
|
|
|
needs: config
|
|
|
|
if: needs.config.outputs.has-secrets
|
2020-10-09 08:20:04 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout Actions
|
2023-09-05 03:10:10 -05:00
|
|
|
uses: actions/checkout@v4
|
2020-10-09 08:20:04 -05:00
|
|
|
with:
|
|
|
|
repository: "grafana/grafana-github-actions"
|
|
|
|
path: ./actions
|
|
|
|
ref: main
|
|
|
|
- name: Install Actions
|
|
|
|
run: npm install --production --prefix ./actions
|
|
|
|
- name: Run metrics collector
|
|
|
|
uses: ./actions/metrics-collector
|
|
|
|
with:
|
|
|
|
metricsWriteAPIKey: ${{secrets.GRAFANA_MISC_STATS_API_KEY}}
|
2024-01-18 09:29:40 -06:00
|
|
|
token: ${{secrets.GITHUB_TOKEN}}
|
2020-10-26 13:43:58 -05:00
|
|
|
configPath: "metrics-collector"
|