-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yml
More file actions
129 lines (122 loc) · 4.9 KB
/
action.yml
File metadata and controls
129 lines (122 loc) · 4.9 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: "pull-request-semver-bumper"
description: "Automated semantic version bumping for Maven, NPM, Python, and generic projects."
branding:
icon: "git-merge"
color: "blue"
inputs:
type:
description: "Project type to bump (maven, npm, python, version-file)"
required: true
token:
description: "GitHub token with permission to fetch PR status and commit changes"
required: true
dry-run:
description: "If true, skip git push"
default: "false"
required: false
bump-command:
description: "Custom command to update the version"
required: false
commit-message:
description: "Custom commit message for version bump commit"
default: "version bump to"
required: false
git-username:
description: "Git username for the commit"
default: "github-actions[bot]"
required: false
git-useremail:
description: "Git user email for the commit"
default: "github-actions[bot]@users.noreply.github.com"
required: false
post-command:
description: "Shell command to run after version bump"
default: ""
required: false
# Specific Inputs
package-json-file:
description: "Path to package.json (npm only)"
default: "package.json"
required: false
pyproject-file:
description: "Path to pyproject.toml (python only)"
default: "pyproject.toml"
required: false
pom-file:
description: "Path to pom.xml (maven only)"
default: "pom.xml"
required: false
version-property-path:
description: "JSON path to version property (maven only)"
default: '["project","version"]'
required: false
version-file:
description: "Path to version file (version-file only)"
default: "VERSION"
required: false
outputs:
bumped:
description: "True if version was bumped"
value: ${{ steps.bump_maven.outputs.bumped || steps.bump_npm.outputs.bumped || steps.bump_python.outputs.bumped || steps.bump_version_file.outputs.bumped }}
new-version:
description: "The new version"
value: ${{ steps.bump_maven.outputs.new-version || steps.bump_npm.outputs.new-version || steps.bump_python.outputs.new-version || steps.bump_version_file.outputs.new-version }}
bumpLevel:
description: "The computed SemVer bump level (major, minor, patch)"
value: ${{ steps.bump_maven.outputs.bumpLevel || steps.bump_npm.outputs.bumpLevel || steps.bump_python.outputs.bumpLevel || steps.bump_version_file.outputs.bumpLevel }}
runs:
using: "composite"
steps:
- name: Bump Maven
if: inputs.type == 'maven'
id: bump_maven
uses: sap/pull-request-semver-bumper/.github/actions/version-bumping/maven@main
with:
token: ${{ inputs.token }}
dry-run: ${{ inputs.dry-run }}
bump-command: ${{ inputs.bump-command || 'mvn org.codehaus.mojo:versions-maven-plugin:set -DnewVersion=@NEW_VERSION@ -s settings.xml' }}
commit-message: ${{ inputs.commit-message }}
git-username: ${{ inputs.git-username }}
git-useremail: ${{ inputs.git-useremail }}
post-command: ${{ inputs.post-command }}
pom-file: ${{ inputs.pom-file }}
version-property-path: ${{ inputs.version-property-path }}
- name: Bump NPM
if: inputs.type == 'npm'
id: bump_npm
uses: sap/pull-request-semver-bumper/.github/actions/version-bumping/npm@main
with:
token: ${{ inputs.token }}
dry-run: ${{ inputs.dry-run }}
bump-command: ${{ inputs.bump-command || 'npm version @NEW_VERSION@ --no-git-tag-version --allow-same-version' }}
commit-message: ${{ inputs.commit-message }}
git-username: ${{ inputs.git-username }}
git-useremail: ${{ inputs.git-useremail }}
post-command: ${{ inputs.post-command }}
package-json-file: ${{ inputs.package-json-file }}
- name: Bump Python
if: inputs.type == 'python'
id: bump_python
uses: sap/pull-request-semver-bumper/.github/actions/version-bumping/python@main
with:
token: ${{ inputs.token }}
dry-run: ${{ inputs.dry-run }}
bump-command: ${{ inputs.bump-command || 'poetry version @NEW_VERSION@' }}
commit-message: ${{ inputs.commit-message }}
git-username: ${{ inputs.git-username }}
git-useremail: ${{ inputs.git-useremail }}
post-command: ${{ inputs.post-command }}
pyproject-file: ${{ inputs.pyproject-file }}
- name: Bump Version File
if: inputs.type == 'version-file'
id: bump_version_file
uses: sap/pull-request-semver-bumper/.github/actions/version-bumping/version-file@main
with:
token: ${{ inputs.token }}
dry-run: ${{ inputs.dry-run }}
bump-command: ${{ inputs.bump-command || 'echo @NEW_VERSION@ > VERSION' }}
commit-message: ${{ inputs.commit-message }}
git-username: ${{ inputs.git-username }}
git-useremail: ${{ inputs.git-useremail }}
post-command: ${{ inputs.post-command }}
version-file: ${{ inputs.version-file }}