-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
49 lines (45 loc) · 1.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
name: "Get OpenAPI updated package version"
description: "A GitHub Action for getting appropriate updated semver OpenAPI package version."
branding:
icon: 'check-square'
color: 'blue'
inputs:
package-version:
required: true
description: "Current package version"
updated-state:
required: true
description: "Updated OpenAPI Diff state. Expected values: no_changes, incompatible, compatible"
outputs:
new-package-version:
description: "New package version"
value: ${{steps.output_version.outputs.new_package_version}}
runs:
using: "composite"
steps:
- name: 'Get next possible versions'
id: semvers
uses: "WyriHaximus/github-action-next-semvers@v1"
with:
version: ${{inputs.package-version}}
- name: "Find appropriate update version"
id: output_version
run: |
new_package_version="";
case "${{inputs.updated-state}}" in
compatible)
new_package_version="${{steps.semvers.outputs.minor}}";
;;
incompatible)
new_package_version="${{steps.semvers.outputs.major}}";
;;
no_changes)
new_package_version="${{inputs.package-version}}";
;;
*)
echo "Invalid updated state. Expected values: 'no_changes', 'incompatible', 'compatible'.";
exit 1;
;;
esac
echo "new_package_version=$new_package_version" >> $GITHUB_OUTPUT
shell: bash