Skip to content

Commit 2b269ec

Browse files
authored
Merge pull request #100 from github/jm-specific-labels-for-releases
feat: release on specific labels
2 parents 2248559 + f7b7e1a commit 2b269ec

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.github/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ version-resolver:
3535
minor:
3636
labels:
3737
- 'enhancement'
38+
- 'fix'
3839
patch:
3940
labels:
40-
- 'fix'
4141
- 'documentation'
4242
- 'maintenance'
4343
default: patch

.github/workflows/release.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
on:
55
workflow_dispatch:
6-
push:
6+
pull_request:
7+
types:
8+
- closed
79
branches:
810
- main
911

@@ -12,6 +14,16 @@
1214

1315
jobs:
1416
create_release:
17+
# release if
18+
# manual deployment OR
19+
# merged to main and labelled with release labels
20+
if: |
21+
(github.event_name == 'workflow_dispatch') ||
22+
(github.event.pull_request.merged == true &&
23+
(contains(github.event.pull_request.labels.*.name, 'breaking') ||
24+
contains(github.event.pull_request.labels.*.name, 'enhancement') ||
25+
contains(github.event.pull_request.labels.*.name, 'vuln') ||
26+
contains(github.event.pull_request.labels.*.name, 'release')))
1527
outputs:
1628
full-tag: ${{ steps.release-drafter.outputs.tag_name }}
1729
short-tag: ${{ steps.get_tag_name.outputs.SHORT_TAG }}

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,6 @@ We are using [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.
7878

7979
## Releases
8080

81-
Releases are automated but if you need to manually initiate a release you can do so through the GitHub Actions UI. If you have permissions to do so, you can navigate to the [Actions tab](https://github.com/github/contributors/actions/workflows/release.yml) and select the `Run workflow` button. This will allow you to select the branch to release from and the version to release.
81+
Releases are automated if a pull request is labelled with our [SemVer related labels](.github/release-drafter.yml) or with the `vuln` or `release` labels.
82+
83+
You can also manually initiate a release you can do so through the GitHub Actions UI. If you have permissions to do so, you can navigate to the [Actions tab](https://github.com/github/contributors/actions/workflows/release.yml) and select the `Run workflow` button. This will allow you to select the branch to release from and the version to release.

0 commit comments

Comments
 (0)