Skip to content

Commit 4bedac2

Browse files
committed
Add missing parameters to action.yml.
1 parent e5d1675 commit 4bedac2

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Example yml:
4343
fetch-depth: 0
4444
- name: Fetch next version
4545
id: nextVersion
46-
uses: freezy/VisualPinball.NextReleaseAction@v0.1.0
46+
uses: freezy/VisualPinball.NextVersionAction@v0.1.2
4747
- name: Log version and next version
4848
run: |
4949
echo "${{ steps.nextVersion.outputs.version }}"

__tests__/main.test.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ beforeAll(async () => {
55
});
66

77
test('should use version from package.json if no tag is available', () => {
8-
const nextVersion = getNextVersion("0.0.1-preview.0", []);
8+
const nextVersion = getNextVersion('0.0.1-preview.0', []);
99
expect(nextVersion).toBe('0.0.1-preview.0');
1010
});
1111

@@ -50,7 +50,7 @@ test('should use bump latest tag if one tag was skipped', () => {
5050
});
5151

5252
test('should use major version from major package.json if no tag matched', () => {
53-
const nextVersion = getNextVersion('0.0.1', [
53+
const nextVersion = getNextVersion('0.0.1', [
5454
'0.0.1-preview.3',
5555
'0.0.1-preview.2',
5656
'0.0.1-preview.1',
@@ -65,7 +65,7 @@ test('should use pre-release version from pre-release package.json if no tag mat
6565
'0.0.1-preview.3',
6666
'0.0.1-preview.2',
6767
'0.0.1-preview.1',
68-
'0.0.1-preview.0'
68+
'0.0.1-preview.0',
6969
]);
7070
expect(nextVersion).toBe('0.1.0-preview.0');
7171
});
@@ -84,16 +84,12 @@ test('should bump final version if tag already exists and ends with 0', () => {
8484
});
8585

8686
test('should throw an error if final version is already tagged and does not end with 0', () => {
87-
const nextVersion = () => getNextVersion('0.2.1', [
88-
'0.2.1',
89-
]);
87+
const nextVersion = () => getNextVersion('0.2.1', ['0.2.1']);
9088
expect(nextVersion).toThrow(Error);
9189
});
9290

9391
test('should throw an error if pre-release version is already tagged and does not end with 0', () => {
94-
const nextVersion = () => getNextVersion('0.2.0-preview.1', [
95-
'0.2.0-preview.1',
96-
]);
92+
const nextVersion = () => getNextVersion('0.2.0-preview.1', ['0.2.0-preview.1']);
9793
expect(nextVersion).toThrow(Error);
9894
});
9995

@@ -102,4 +98,3 @@ test('should throw an error for wrong versions', () => {
10298
expect(() => getNextVersion('1.0', [])).toThrow(Error);
10399
expect(() => getNextVersion('~1.0.0', [])).toThrow(Error);
104100
});
105-

action.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
name: 'VisualPinball.NextReleaseAction'
22
description: 'Action used for determining the next version of VisualPinball.* projects.'
33
author: 'Jason Millard <[email protected]>'
4+
inputs:
5+
tagPrefix:
6+
required: false
7+
description: 'Prefix when tagging the release'
48
outputs:
59
version:
6-
description: 'current package.json version'
10+
description: 'Current version in package.json'
711
tags:
8-
description: 'reverse sorted git tags in semver format'
12+
description: 'Reverse sorted git tags in semver format'
913
nextVersion:
10-
description: 'calculated next version'
14+
description: 'Computed next version'
15+
nextTag:
16+
description: 'Computed next version with prefix'
1117
runs:
1218
using: 'node12'
1319
main: 'dist/index.js'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "visualpinball-next-version-action",
3-
"version": "0.1.0",
3+
"version": "0.1.2",
44
"description": "Action used for determining the next version of VisualPinball.* projects.",
55
"main": "lib/main.js",
66
"scripts": {

0 commit comments

Comments
 (0)