-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
89 lines (89 loc) · 3.38 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Changelog Management
description: Provides tasks for changelogs in Keep a Changelog 1.0.0 format, including releasing, reading, and adding new changes.
branding:
icon: list
color: yellow
inputs:
path:
description: Path to relative to the root of the project to a CHANGELOG.md file in Keep a Changelog 1.0.0 format. Defaults to CHANGELOG.md in the root of the project.
required: false
default: CHANGELOG.md
mode:
description: Mode for the action. Should be one of `readdata`, `release`, or `addchange`. Defaults to `readdata`.
required: false
default: readdata
releaseVersion:
description: Version number to use when updating a changelog for release. Only valid for mode `release`.
required: false
changeType:
description: Type of change to add. Should be one of `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, or `Security`. Only valid for mode `addchange`.
required: false
changeValue:
description: Data for the change to add. Should be a single line string. Only valid for mode `addchange`.
required: false
outputs:
lastVersion:
description: The version number of the latest release in the changelog.
value: ${{ steps.readdata.outputs.lastVersion }}
releaseNotes:
description: Release notes composed of changes from the most recent release.
value: ${{ steps.readdata.outputs.releaseNotes }}
runs:
using: composite
steps:
- name: Validate Inputs
id: validateinputs
run: . "$env:GITHUB_ACTION_PATH\src\steps\1_validateinputs.ps1"
shell: pwsh
env:
INPUT_PATH: ${{ inputs.path }}
INPUT_MODE: ${{ inputs.mode }}
INPUT_RELEASEVERSION: ${{ inputs.releaseVersion }}
INPUT_CHANGETYPE: ${{ inputs.changeType }}
INPUT_CHANGEVALUE: ${{ inputs.changeValue }}
- name: Install Module
id: installmodule
run: . "$env:GITHUB_ACTION_PATH\src\steps\2_installmodule.ps1"
shell: pwsh
env:
INPUT_PATH: ${{ inputs.path }}
INPUT_MODE: ${{ inputs.mode }}
INPUT_RELEASEVERSION: ${{ inputs.releaseVersion }}
INPUT_CHANGETYPE: ${{ inputs.changeType }}
INPUT_CHANGEVALUE: ${{ inputs.changeValue }}
- name: Add Change
id: addchange
run: |
if ($env:INPUT_MODE -eq "addchange") {
. "$env:GITHUB_ACTION_PATH\src\steps\3_addchange.ps1"
}
shell: pwsh
env:
INPUT_PATH: ${{ inputs.path }}
INPUT_MODE: ${{ inputs.mode }}
INPUT_RELEASEVERSION: ${{ inputs.releaseVersion }}
INPUT_CHANGETYPE: ${{ inputs.changeType }}
INPUT_CHANGEVALUE: ${{ inputs.changeValue }}
- name: Release
id: release
run: |
if ($env:INPUT_MODE -eq "release") {
. "$env:GITHUB_ACTION_PATH\src\steps\4_release.ps1"
}
shell: pwsh
env:
INPUT_PATH: ${{ inputs.path }}
INPUT_MODE: ${{ inputs.mode }}
INPUT_RELEASEVERSION: ${{ inputs.releaseVersion }}
INPUT_CHANGETYPE: ${{ inputs.changeType }}
INPUT_CHANGEVALUE: ${{ inputs.changeValue }}
- name: Read Data
id: readdata
run: . "$env:GITHUB_ACTION_PATH\src\steps\5_readdata.ps1"
shell: pwsh
env:
INPUT_PATH: ${{ inputs.path }}
INPUT_MODE: ${{ inputs.mode }}
INPUT_RELEASEVERSION: ${{ inputs.releaseVersion }}
INPUT_CHANGETYPE: ${{ inputs.changeType }}
INPUT_CHANGEVALUE: ${{ inputs.changeValue }}