Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A GitHub Action to roughly calculate DORA deployment frequency

License

NotificationsYou must be signed in to change notification settings

DeveloperMetrics/deployment-frequency

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

333 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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? Ourinsights indicated that many applications don't need exhaustive DORA analysis - a high level, order of magnitude result is accurate for most workloads.

CICurrent Release

Current Calculation

  • Get the last 100 completed workflows
  • For each workflow, if it started in the last 30 days, and add it to a secondary filtered list - this is the number of deployments in the last 30 days
  • With this filtered list, divide the count by the 30 days for a number of deployments per day
  • Then translate this result to friendly n days/weeks/months.
  • As the cost is relatively low (1 Rest API call to GitHub), a result is typically returned in 5-10s.

Current Limitations

  • Only looks at the last 100 completed workflows. If number of deployments to the target branch is low, this will skew the result.

Inputs

  • workflows: required, string, The name of the workflows to process. Multiple workflows can be separated by,
  • owner-repo: optional, string, defaults to the repo where the action runs. Can target another owner or org and repo. e.g.'DeveloperMetrics/DevOpsMetrics', but will require authenication (see below)
  • default-branch: optional, string, defaults tomain
  • number-of-days: optional, integer, defaults to30 (days)
  • pat-token: optional, string, defaults to ''. Can be set with GitHub PAT token. Ensure thatRead access to actions and metadata permission is set. This is a secret, never directly add this into the actions workflow, use a secret.
  • actions-token: optional, string, defaults to ''. Can be set with${{ secrets.GITHUB_TOKEN }} in the action
  • app-id: optional, string, defaults to '', application id of the registered GitHub app
  • app-install-id: optional, string, defaults to '', id of the installed instance of the GitHub app
  • app-private-key: optional, string, defaults to '', private key which has been generated for the installed instance of the GitHub app. Must be provided without leading'-----BEGIN RSA PRIVATE KEY----- ' and trailing' -----END RSA PRIVATE KEY-----'.

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

-uses:DeveloperMetrics/deployment-frequency@mainwith:workflows:'CI'

To test another repo, with all arguments

-name:Test another repouses:DeveloperMetrics/deployment-frequency@mainwith: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 Tokenuses:DeveloperMetrics/deployment-frequency@mainwith: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 Tokenuses:DeveloperMetrics/deployment-frequency@mainwith:workflows:'CI'actions-token:"${{ secrets.GITHUB_TOKEN }}"

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

-name:Test another repo with GitHub Appuses:DeveloperMetrics/deployment-frequency@mainwith: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 fileuses:DeveloperMetrics/deployment-frequency@mainid:deployment-frequencywith: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/SamsFeatureFlagsWorkflows: Feature Flags CI/CDBranch: mainNumber of days: 30Authentication detected: GITHUB APP TOKENRate limit consumption: 10 / 5000Deployment 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 is4.67 times per week with aHigh rating, over the last30 days.
Details:

  • Repository: DeveloperMetrics/deployment-frequency using main branch
  • Workflow(s) used: CI
  • Active days of deployment: 13 days

About

A GitHub Action to roughly calculate DORA deployment frequency

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors6


[8]ページ先頭

©2009-2026 Movatter.jp