forked from DeveloperMetrics/deployment-frequency
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
53 lines (53 loc) · 2.46 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: 'DORA deployment frequency'
description: 'A GitHub Action to roughly calculate DORA deployment frequency'
author: developermetrics.org
branding:
icon: activity
color: gray-dark
inputs:
workflows: # required. string array of the name of the workflows to process
description: the workflow name that is being scanned. Separate multiple workflows with commas
required: true
owner-repo: # optional, defaults to current owner/repo
description: target org/repo or owner/repo to run the calculation on
required: true
default: "${{ github.repository }}"
default-branch: # optional, defaults to main
description: branch that is deploying to production
required: true
default: 'main'
number-of-days: # optional, defaults to 30
description: number of days to scan
required: true
default: "30"
pat-token: # optional, defaults to an empty string ("")
description: GitHub PAT Token
default: ""
actions-token: # optional, defaults to an empty string ("")
description: GitHub Actions Token, commonly passed in as a variable (secrets.GITHUB_TOKEN)
default: ""
app-id:
description: 'application id of the registered GitHub app'
default: ""
app-install-id:
description: 'id of the installed instance of the GitHub app'
default: ""
app-private-key:
description: 'private key which has been generated for the installed instance of the GitHub app'
default: ""
outputs:
markdown-file:
description: "The markdown that will be posted to the job summary, so that the markdown can saved and used other places (e.g.: README.md)"
value: ${{ steps.deployment-frequency.outputs.markdown-file }}
runs:
using: "composite"
steps:
- name: Run DORA deployment frequency
id: deployment-frequency
shell: pwsh
run: |
$result = ${{ github.action_path }}/src/deploymentfrequency.ps1 -ownerRepo "${{ inputs.owner-repo }}" -workflows "${{ inputs.workflows }}" -branch "${{ inputs.default-branch }}" -numberOfDays ${{ inputs.number-of-days }} -patToken "${{ inputs.pat-token }}" -actionsToken "${{ inputs.actions-token }}" -appId "${{ inputs.app-id }}" -appInstallationId "${{ inputs.app-install-id }}" -appPrivateKey "${{ inputs.app-private-key }}"
$filePath="dora-deployment-frequency-markdown.md"
Set-Content -Path $filePath -Value $result
"markdown-file=$filePath" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
Write-Output $result >> $env:GITHUB_STEP_SUMMARY