Skip to content

rewindio/github-deployment-metrics

Repository files navigation

github-deployment-metrics

Pulls metrics from github actions around deployments

Installation

git clone rewindio/github-deployment-metrics
pip3 install -r requirements.txt

Prerequistes

  • A Github Personal Access Token (PAT) that has repo and admin:org scopes
  • The Github PAT set in an environment variable named GITHUB_PAT OR contained in a .env file

Usage

usage: get-deployment-metrics.py [-h] --org-name ORG_NAME --deploy-workflow-pattern WORKFLOW_PATTERN --date-filter DATE_FILTER [--detailed] [--include-manual-runs] [--verbose]

Gather deployment metrics from Github actions

options:
  -h, --help            show this help message and exit
  --org-name ORG_NAME   Github organization name
  --deploy-workflow-pattern WORKFLOW_PATTERN
                        Track stats for all jobs run matching this workflow name pattern (eg. *Deploy*)
  --date-filter DATE_FILTER
                        Github start/end date filter (eg. 2023-03-01..2023-03-31)
  --detailed            Show detailed output for each repo
  --include-manual-runs
                        Include manual workflow runs in stats computations
  --verbose             Turn on DEBUG logging

Example Execution

./get-deployment-metrics.py --org-name acme --deploy-workflow-pattern '*Deploy*' --date-filter '2023-03-01..2023-03-31' --detailed

Notes

  • By default, manually invoked workflows are skipped and not included in the metrics. You can override this with the --include_manual_runs flag
  • Archived repos are ignored
  • The date-filter option uses the Github date filtering syntax
  • The deploy-workflow-pattern must be a valid pattern as supported by the python fnmatch module

About

Pulls deployment metrics from Github actions

Topics

Resources

License

Stars

Watchers

Forks

Languages