DeveloperMetrics / deployment-frequency

A GitHub Action to roughly calculate DORA deployment frequency
MIT License
16 stars 10 forks source link
action deployment-frequency dora

Deployment Frequency

A GitHub Action to roughly calculate DORA deployment frequency. This is not meant to be an exhaustive calculation, but we are able to approximate fairly close for most of workflows. Why? Our insights indicated that many applications don't need exhaustive DORA analysis - a high level, order of magnitude result is accurate for most workloads.

CI Current Release

Current Calculation

Current Limitations

Inputs

To test the current repo (same as where the action runs)

- uses: DeveloperMetrics/deployment-frequency@main
  with:
    workflows: 'CI'

To test another repo, with all arguments

- name: Test another repo
  uses: DeveloperMetrics/deployment-frequency@main
  with:
    workflows: 'CI/CD'
    owner-repo: 'DeveloperMetrics/DevOpsMetrics'
    default-branch: 'main'
    number-of-days: 30

To use a PAT token to access another (potentially private) repo:

- name: Test elite repo with PAT Token
  uses: DeveloperMetrics/deployment-frequency@main
  with:
    workflows: 'CI/CD'
    owner-repo: 'samsmithnz/SamsFeatureFlags'
    pat-token: "${{ secrets.PATTOKEN }}"

Use the built in Actions GitHub Token to retrieve the metrics

- name: Test this repo with GitHub Token
  uses: DeveloperMetrics/deployment-frequency@main
  with:
    workflows: 'CI'
    actions-token: "${{ secrets.GITHUB_TOKEN }}"

Gather the metric from another repository using GitHub App authentication method:

- name: Test another repo with GitHub App
  uses: DeveloperMetrics/deployment-frequency@main
  with:
    workflows: 'CI'
    owner-repo: 'DeveloperMetrics/some-other-repo'
    app-id: "${{ secrets.APPID }}"
    app-install-id: "${{ secrets.APPINSTALLID }}"
    app-private-key: "${{ secrets.APPPRIVATEKEY }}"

Use the markdown file output for some other action downstream:

- name: Generate deployment frequency markdown file
  uses: DeveloperMetrics/deployment-frequency@main
  id: deployment-frequency
  with:
    workflows: 'CI'
    actions-token: "${{ secrets.GITHUB_TOKEN }}"
- run: cat ${{ steps.deployment-frequency.outputs.markdown-file }})

Output

Current output to the log shows the inputs, authenication method, rate limit consumption, and then the actual deployment frequency

Owner/Repo: samsmithnz/SamsFeatureFlags
Workflows: Feature Flags CI/CD
Branch: main
Number of days: 30
Authentication detected: GITHUB APP TOKEN
Rate limit consumption: 10 / 5000
Deployment frequency over last 30 days, is 1.2 per day, with a DORA rating of 'Elite'

In the job summary, we show a badge with details:


Deployment Frequency
Definition: For the primary application or service, how often is it successfully deployed to production.
Results: Deployment frequency is 4.67 times per week with a High rating, over the last 30 days.
Details: