-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
113 lines (112 loc) · 3.33 KB
/
action.yml
File metadata and controls
113 lines (112 loc) · 3.33 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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: "semver-cli"
description: "Semver utility action"
branding:
icon: activity
color: orange
inputs:
command:
type: choice
description: Command
default: get
required: false
options:
- get
- set
- inc
- parse
- eq
- cmp
- gt
- gte
- lt
- lte
- sort
sub-command:
type: choice
description: "The kind of increment (major|minor|patch|none) for (get|inc) commands"
required: false
options:
- major
- minor
- patch
- none
prerelease:
type: string
description: Optional Prerelease Metadata
required: false
build:
type: string
description: Optional Build Metadata
required: false
value:
type: string
description: The Version (for set, parse, eq, cmp, gt, gte, lt, lte commands) or space-separated versions (for sort command)
required: false
compare-to:
type: string
description: "The version to compare to (for eq, cmp, gt, gte, lt, lte commands)"
required: false
config:
type: string
description: "Path to a configuration file"
required: false
outputs:
version:
description: "The resulting version change"
value: ${{ steps.version.outputs.version }}
version_docker:
description: "The resulting version change formatted to be compatible with docker tags"
value: ${{ steps.version.outputs.version_docker }}
version_dotnet:
description: "The resulting version change formatted to be compatible with dotnet"
value: ${{ steps.version.outputs.version_dotnet }}
major:
description: "If parsing, the major version"
value: ${{ steps.version.outputs.major }}
minor:
description: "If parsing, the minor version"
value: ${{ steps.version.outputs.minor }}
patch:
description: "If parsing, the patch version"
value: ${{ steps.version.outputs.patch }}
prerelease:
description: "If parsing, the prerelease version"
value: ${{ steps.version.outputs.prerelease }}
build:
description: "If parsing, the build version"
value: ${{ steps.version.outputs.build }}
v1:
description: "If comparing, the first version"
value: ${{ steps.version.outputs.v1 }}
v2:
description: "If comparing, the second version"
value: ${{ steps.version.outputs.v2 }}
result:
description: "If comparing, the result of the comparison (-1|0|1)"
value: ${{ steps.version.outputs.result }}
command:
description: "If comparing, the comparison that was run"
value: ${{ steps.version.outputs.command }}
runs:
using: "composite"
steps:
- id: version
name: Run Semver ${{ inputs.command }}
shell: bash
run: |
ARGS=("$COMMAND")
[[ -n "$SUB_COMMAND" ]] && ARGS+=("$SUB_COMMAND")
[[ -n "$VALUE" ]] && ARGS+=("$VALUE")
[[ -n "$COMPARE_TO" ]] && ARGS+=("$COMPARE_TO")
[[ -n "$PRERELEASE" ]] && ARGS+=("--prerelease" "$PRERELEASE")
[[ -n "$BUILD" ]] && ARGS+=("--build" "$BUILD")
[[ -n "$CONFIG" ]] && ARGS+=("--config" "$CONFIG")
semver "${ARGS[@]}"
env:
COMMAND: "${{ inputs.command }}"
SUB_COMMAND: "${{ inputs.sub-command }}"
VALUE: "${{ inputs.value }}"
COMPARE_TO: "${{ inputs.compare-to }}"
PRERELEASE: "${{ inputs.prerelease }}"
BUILD: "${{ inputs.build }}"
CONFIG: "${{ inputs.config }}"