-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathaction.yml
More file actions
60 lines (60 loc) · 2.85 KB
/
action.yml
File metadata and controls
60 lines (60 loc) · 2.85 KB
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
54
55
56
57
58
59
60
name: 'DORA lead time for changes'
description: 'A GitHub Action to roughly calculate DORA lead time for changes'
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: 'the 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
commit-counting-method: #optional, defaults to 'last'
description: accepts two values, 'last' - to start timing from the last commit of a PR, and 'first' to start timing from the first commit of a PR
required: true
default: 'last'
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: ""
api-url:
description: 'the URL of the GitHub API'
default: ${{ github.api_url }}
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.lead-time.outputs.markdown-file }}
runs:
using: "composite"
steps:
- name: Run DORA lead time for changes
id: lead-time
shell: pwsh
run: |
$result = ${{ github.action_path }}/src/leadtimeforchanges.ps1 -ownerRepo "${{ inputs.owner-repo }}" -workflows "${{ inputs.workflows }}" -branch "${{ inputs.default-branch }}" -numberOfDays ${{ inputs.number-of-days }} -commitCountingMethod ${{ inputs.commit-counting-method }} -patToken "${{ inputs.pat-token }}" -actionsToken "${{ inputs.actions-token }}" -appId "${{ inputs.app-id }}" -appInstallationId "${{ inputs.app-install-id }}" -appPrivateKey "${{ inputs.app-private-key }}" -apiUrl "${{ inputs.api-url }}"
$filePath="dora-lead-time-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