Skip to content

Commit 2287947

Browse files
🚀[Feature] Auto-cleanup prereleases + Create tags (#16)
Fixes If PR is closed and not merged, remove prereleases #3 Fixes Make cleanup optional using a parameter #5 Fixes Make major (vX) and minor (vX.Y) tags optional, on by default, using a parameter #6
1 parent 93d444d commit 2287947

File tree

3 files changed

+171
-137
lines changed

3 files changed

+171
-137
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Automatically creates releases based on pull requests and labels.
55
## Specifications and practices
66

77
Auto-Release follows:
8-
Test
98

109
- [SemVer 2.0.0 specifications](https://semver.org)
1110
- [GitHub Flow specifications](https://docs.github.com/en/get-started/using-github/github-flow)
@@ -17,9 +16,12 @@ The action have the following parameters:
1716

1817
| Parameter | Description | Default | Required |
1918
| --- | --- | --- | --- |
19+
| `AutoCleanup`| Control wether to automatically cleanup prereleases. If disabled, the action will not remove any prereleases. | `true` | false |
2020
| `AutoPatching` | Control wether to automatically handle patches. If disabled, the action will only create a patch release if the pull request has a 'patch' label. | `true` | false |
21+
| `CreateMajorTag` | Control wether to create a tag for major releases. | `true` | false |
22+
| `CreateMinorTag` | Control wether to create a tag for minor releases. | `true` | false |
23+
| `DatePrereleaseFormat` | The format to use for the prerelease number using [.NET DateTime format strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings). | `''` | false |
2124
| `IncrementalPrerelease` | Control wether to automatically increment the prerelease number. If disabled, the action will ensure only one prerelease exists for a given branch. | `true` | false |
22-
| `DataPrereleaseFormat` | The format to use for the prerelease number using [.NET DateTime format strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings). | `''` | false |
2325
| `VersionPrefix` | The prefix to use for the version number. | `v` | false |
2426

2527
### Example

action.yml

+19-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
11
name: Auto-Release (by PSModule)
22
description: Automatically creates releases based on pull requests and labels.
3-
3+
author: PSModule
44
branding:
55
icon: activity
66
color: blue
77

88
inputs:
9+
AutoCleanup:
10+
description: Control wether to automatically delete the prerelease tags after the stable release is created.
11+
required: false
12+
default: 'true'
913
AutoPatching:
1014
description: Control wether to automatically handle patches. If disabled, the action will only create a patch release if the pull request has a 'patch' label.
1115
required: false
1216
default: 'true'
13-
IncrementalPrerelease:
14-
description: Control wether to automatically increment the prerelease number. If disabled, the action will ensure only one prerelease exists for a given branch.
17+
CreateMajorTag:
18+
description: Control wether to create a major tag when a pull request is merged into the main branch.
19+
required: false
20+
default: 'true'
21+
CreateMinorTag:
22+
description: Control wether to create a minor tag when a pull request is merged into the main branch.
1523
required: false
1624
default: 'true'
1725
DatePrereleaseFormat:
1826
description: If specified, uses a date based prerelease scheme. The format should be a valid .NET format string like 'yyyyMMddHHmm'.
1927
required: false
2028
default: ''
29+
IncrementalPrerelease:
30+
description: Control wether to automatically increment the prerelease number. If disabled, the action will ensure only one prerelease exists for a given branch.
31+
required: false
32+
default: 'true'
2133
VersionPrefix:
2234
description: The prefix to use for the version number.
2335
required: false
@@ -29,8 +41,11 @@ runs:
2941
- name: Auto-Release
3042
shell: pwsh
3143
env:
44+
AutoCleanup: ${{ inputs.AutoCleanup }}
3245
AutoPatching: ${{ inputs.AutoPatching }}
46+
CreateMajorTag: ${{ inputs.CreateMajorTag }}
47+
CreateMinorTag: ${{ inputs.CreateMinorTag }}
48+
DatePrereleaseFormat: ${{ inputs.DatePrereleaseFormat }}
3349
IncrementalPrerelease: ${{ inputs.IncrementalPrerelease }}
3450
VersionPrefix: ${{ inputs.VersionPrefix }}
35-
DatePrereleaseFormat: ${{ inputs.DatePrereleaseFormat }}
3651
run: . "$env:GITHUB_ACTION_PATH\scripts\main.ps1"

0 commit comments

Comments
 (0)