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: |
|
|
|
|
if [ -n "${{ (secrets.GRAFANA_MISC_STATS_API_KEY != '' && secrets.GH_BOT_ACCESS_TOKEN != '') || '' }}" ]; then
|
|
|
|
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
|
2022-04-08 03:26:30 -05:00
|
|
|
uses: actions/checkout@v3
|
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}}
|
|
|
|
token: ${{secrets.GH_BOT_ACCESS_TOKEN}}
|
2020-10-26 13:43:58 -05:00
|
|
|
configPath: "metrics-collector"
|