Skip to content

Create Badge on DevOps Metrics #758

Create Badge on DevOps Metrics

Create Badge on DevOps Metrics #758

Workflow file for this run

name: Create Badge on DevOps Metrics
on:
push:
branches:
- main
schedule:
- cron: '30 0 * * *'
permissions:
contents: read
jobs:
update-metrics:
runs-on: ubuntu-latest
name: Checking the dora metrics
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- name: DevOps Metrics from GitHub
uses: stenjo/devops-metrics-action@v1
id: dora
with:
owner: 'stenjo'
repo: 'devops-metrics-action'
token: ${{ secrets.GITHUB_TOKEN }}
# Use the output from the `dora` step
- name: Get the output rate
run: echo "The deploy rate was ${{ steps.dora.outputs.deploy-rate }}" # Use the output from the `dora` step
- name: Get the lead time
run: echo "The lead time was ${{ steps.dora.outputs.lead-time }}" # Use the output from the `dora` step
- name: Get the change failure rate
run: echo "The change failure rate was ${{
steps.dora.outputs.change-failure-rate }}"
- name: Get the mean time to restore
run: echo "The mean time to restore was ${{ steps.dora.outputs.mttr }}"
- name: Create the Badge for Deploy Rate
uses: Schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GIST_AUTH_TOKEN }}
gistID: ebb0efc5ab5afb32eae4d0cdc60d563a
filename: deploy-rate.json
label: Deploy Rate
message: ${{ steps.dora.outputs.deploy-rate }}
valColorRange: ${{ steps.dora.outputs.deploy-rate }}
maxColorRange: 7
minColorRange: 1
- name: Create the Badge for Lead Time
uses: Schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GIST_AUTH_TOKEN }}
gistID: ebb0efc5ab5afb32eae4d0cdc60d563a
filename: lead-time.json
label: Lead Time
message: ${{ steps.dora.outputs.lead-time }}
valColorRange: ${{ steps.dora.outputs.lead-time }}
maxColorRange: 7
minColorRange: 3
invertColorRange: true
- name: Create the Badge for Change Failure Rate
uses: Schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GIST_AUTH_TOKEN }}
gistID: ebb0efc5ab5afb32eae4d0cdc60d563a
filename: change-failure-rate.json
label: Change Failure Rate
message: ${{ steps.dora.outputs.change-failure-rate }}%
valColorRange: ${{ steps.dora.outputs.change-failure-rate }}
maxColorRange: 15
minColorRange: 1
invertColorRange: true
- name: Create the Badge for Mean time to Restore
uses: Schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GIST_AUTH_TOKEN }}
gistID: ebb0efc5ab5afb32eae4d0cdc60d563a
filename: mean-time-to-restore.json
label: Mean time to Restore
message: ${{ steps.dora.outputs.mttr }}
valColorRange: ${{ steps.dora.outputs.mttr }}
maxColorRange: 3
minColorRange: 1
invertColorRange: true