Skip to content

Commit 9ac46b3

Browse files
authored
[CI] add action to label PRs based on title and draft releases (#327)
* add action to label PRs based on title and draft releases
1 parent 87a2c65 commit 9ac46b3

File tree

6 files changed

+141
-62
lines changed

6 files changed

+141
-62
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
<!-- If this is your first PR, welcome! Please make sure you read the [contributing guidelines](../CONTRIBUTING.md). -->
2-
3-
<!-- Please label this pull request according to what type of issue you are addressing (see ../CONTRIBUTING.md) -->
4-
**What type of PR is this?**
5-
6-
<!--
7-
Add one of the following kinds:
8-
/kind feature
9-
/kind bug
10-
/kind api-change
11-
/kind cleanup
12-
/kind deprecation
13-
/kind design
14-
/kind documentation
15-
/kind testing
2+
<!-- Ensure your PR title complies with the following guidelines
3+
1. All PRs titles should start with one of the following prefixes
4+
- `[fix]` for PRs related to bug fixes and patches
5+
- `[feat]` for PRs related to new features
6+
- `[improvement]` for PRs related to improvements of existing features
7+
- `[test]` for PRs related to tests
8+
- `[CI]` for PRs related to repo CI improvements
9+
- `[docs]` for PRs related to documentation updates
10+
- `[deps]` for PRs related to dependency updates
11+
2. if a PR introduces a breaking change it should include `[breaking]` in the title
12+
3. if a PR introduces a deprecation it should include `[deprecation]` in the title
1613
-->
17-
1814
**What this PR does / why we need it**:
1915

2016
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:

.github/labels.yml

+31-20
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
1-
- name: added-feature
1+
# PR Labels
2+
- name: new-feature
23
description: for new features in the changelog.
3-
color: a2eeef
4-
- name: changed
5-
description: for changes in existing functionality in the changelog.
6-
color: a2eeef
7-
- name: deprecated
8-
description: for soon-to-be removed features in the changelog.
9-
color: e4e669
10-
- name: removed
11-
description: for now removed features in the changelog.
12-
color: e4e669
4+
color: 225fee
5+
- name: improvement
6+
description: for improvements in existing functionality in the changelog.
7+
color: 22ee47
8+
- name: repo-ci-improvement
9+
description: for improvements in the repository or CI workflow in the changelog.
10+
color: c922ee
1311
- name: bugfix
1412
description: for any bug fixes in the changelog.
15-
color: d73a4a
16-
- name: security
17-
description: for vulnerabilities in the changelog.
18-
color: dd4739
19-
- name: bug
20-
description: Something isn't working in this issue.
21-
color: d73a4a
13+
color: ed8e21
14+
- name: documentation
15+
description: for updates to the documentation in the changelog.
16+
color: d3e1e6
17+
- name: dependencies
18+
description: dependency updates including security fixes
19+
color: 5c9dff
20+
- name: testing
21+
description: for updates to the testing suite in the changelog.
22+
color: 933ac9
23+
- name: breaking-change
24+
description: for breaking changes in the changelog.
25+
color: ff0000
26+
- name: ignore-for-release
27+
description: PRs you do not want to render in the changelog.
28+
color: 7b8eac
29+
# Issue Labels
2230
- name: enhancement
23-
description: New feature request in this issue.
24-
color: a2eeef
31+
description: issues that request a enhancement.
32+
color: 22ee47
33+
- name: bug
34+
description: issues that report a bug.
35+
color: ed8e21

.github/release-drafter.yml

+61-15
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,67 @@
11
name-template: 'v$NEXT_PATCH_VERSION'
22
tag-template: 'v$NEXT_PATCH_VERSION'
3+
exclude-labels:
4+
- ignore-for-release
35
categories:
4-
- title: '🚀 Added'
5-
label: 'added-feature'
6-
- title: '🧰 Changed'
7-
label: 'changed'
8-
- title: "⚠️ Deprecated"
9-
label: "deprecated"
10-
- title: "⚠️ Removed"
11-
label: "removed"
12-
- title: '🐛 Bug Fixes'
13-
label: 'bugfix'
14-
- title: "⚠️ Security"
15-
label: "security"
16-
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
6+
- title: ⚠️ Breaking Change
7+
labels:
8+
- breaking-change
9+
- title: 🐛 Bug Fixes
10+
labels:
11+
- bugfix
12+
- title: 🚀 New Features
13+
labels:
14+
- new-feature
15+
- title: 💡 Improvements
16+
labels:
17+
- improvement
18+
- title: 🧪 Testing Improvements
19+
labels:
20+
- testing
21+
- title: ⚙️ Repo/CI Improvements
22+
labels:
23+
- repo-ci-improvement
24+
- title: 📖 Documentation
25+
labels:
26+
- documentation
27+
- title: 📦 Dependency Updates
28+
labels:
29+
- dependencies
30+
- title: Other Changes
31+
labels:
32+
- "*"
33+
autolabeler:
34+
- label: 'breaking-change'
35+
title:
36+
- '/.*\[breaking\].+/'
37+
- label: 'deprecation'
38+
title:
39+
- '/.*\[deprecation\].+/'
40+
- label: 'bugfix'
41+
title:
42+
- '/.*\[fix\].+/'
43+
- label: 'new-feature'
44+
title:
45+
- '/.*\[feat\].+/'
46+
- label: 'improvement'
47+
title:
48+
- '/.*\[improvement\].+/'
49+
- label: 'testing'
50+
title:
51+
- '/.*\[test\].+/'
52+
- label: 'repo-ci-improvement'
53+
title:
54+
- '/.*\[CI\].+/'
55+
- '/.*\[ci\].+/'
56+
- label: 'documentation'
57+
title:
58+
- '/.*\[docs\].+/'
59+
- label: 'dependencies'
60+
title:
61+
- '/.*\[deps\].+/'
62+
63+
change-template: '- $TITLE by @$AUTHOR in #$NUMBER'
1764
no-changes-template: "- No changes"
1865
template: |
19-
## Changes
20-
66+
## What's Changed
2167
$CHANGES

.github/workflows/build_test_ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
storage.googleapis.com:443
6464
cli.codecov.io:443
6565
api.codecov.io:443
66+
raw.githubusercontent.com:443
6667
6768
- uses: actions/checkout@v4
6869

.github/workflows/release-drafter.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [opened, reopened, synchronize]
9+
pull_request_target:
10+
types: [opened, reopened, synchronize]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
update_release_draft:
17+
permissions:
18+
contents: write
19+
pull-requests: write
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: release-drafter/release-drafter@v6
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,20 @@ Tips for a faster merge:
3939
1. Fork the desired repo, develop and test your code changes.
4040
1. See the [Development Guide](https://linode.github.io/cluster-api-provider-linode/developers/development.html) for more instructions on setting up your environment and testing changes locally.
4141
2. Submit a pull request.
42-
1. All PRs should be labeled with one of the following kinds
43-
- `/kind feature` for PRs related to adding new features/tests
44-
- `/kind bug` for PRs related to bug fixes and patches
45-
- `/kind api-change` for PRs related to adding, removing, or otherwise changing an API
46-
- `/kind cleanup` for PRs related to code refactoring and cleanup
47-
- `/kind deprecation` for PRs related to a feature/enhancement marked for deprecation.
48-
- `/kind design` for PRs related to design proposals
49-
- `/kind documentation` for PRs related to documentation
50-
- `/kind other` for PRs related to updating dependencies, minor changes or other
51-
2. All code changes must be covered by unit tests and E2E tests.
52-
3. All new features should come with user documentation.
42+
1. All PRs titles should start with one of the following prefixes
43+
- `[fix]` for PRs related to bug fixes and patches
44+
- `[feat]` for PRs related to new features
45+
- `[improvement]` for PRs related to improvements of existing features
46+
- `[test]` for PRs related to tests
47+
- `[CI]` for PRs related to repo CI improvements
48+
- `[docs]` for PRs related to documentation updates
49+
- `[deps]` for PRs related to dependency updates
50+
2. if a PR introduces a breaking change it should include `[breaking]` in the title
51+
3. if a PR introduces a deprecation it should include `[deprecation]` in the title
52+
4. All code changes must be covered by unit tests and E2E tests.
53+
5. All new features should come with user documentation.
5354
3. Ensure that commit message(s) are be meaningful and commit history is readable.
54-
5. All changes must be code reviewed. Refer to the following for code conventions and standards:
55+
4. All changes must be code reviewed. Refer to the following for code conventions and standards:
5556
- The official [Kubernetes developer guide](https://github.com/kubernetes/community/tree/master/contributors/devel)
5657
- [Go Code Review Comments](https://go.dev/wiki/CodeReviewComments) identifies some common style mistakes when writing Go
5758
- [Uber's Go Style Guide](https://github.com/uber-go/guide/blob/master/style.md) promotes preferred code conventions

0 commit comments

Comments
 (0)