Skip to content

Commit

Permalink
fix: stop writing your changelogs manually (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar authored Jul 4, 2023
1 parent 6fe19f8 commit 9147139
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 25 deletions.
12 changes: 12 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
feature: ['feat/*', 'feature/*']
enhancement: ['enhance/*', 'enhancement/*']
fix: ['fix/*', 'bug/*', 'bugfix/*', 'hotfix/*']
changes: ['change/*', 'changes/*', 'changed/*']
performance: ['perf/*', 'performance/*']
refactor: ['refactor/*']
devops: ['build/*', 'ops/*', 'devops/*']
deprecates: ['deprecate/*', 'deprecates/*', 'deprecated/*']
removes: ['remove/*', 'removes/*', 'removed/*', 'delete/*', 'deletes/*', 'deleted/*']
security: ['secure/*', 'secures/*', 'secured/*', 'security/*']
docs: ['docs/*', 'documentation/*']
dependencies: ['deps/*', 'dependencies/*']
20 changes: 10 additions & 10 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,34 @@ template: |
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
categories:
- title: 🚀 Added Features
# labels should include values of .github/pr-labeler.yaml
- title: 🚀 Added
labels:
- feat
- feature
- enhancement
- title: 🪲 Fixed Bugs
- title: 🪲 Fixed
labels:
- fix
- bug
- title: ⚠️ Changed
labels:
- changed
- changes
- performance
- devops
- test
- title: ⛔️ Deprecated
labels:
- deprecated
- deprecates
- title: 🗑 Removed
labels:
- removed
- removes
- title: 🔐 Security
labels:
- security
- title: 📓 Documentation
labels:
- docs
- documentation
- title: 🧩 Updated
labels:
- deps
- dependencies
collapse-after: 5

Expand All @@ -54,5 +54,5 @@ version-resolver:
default: patch

exclude-labels:
- style
- chore
- skip-changelog
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Update Changelog
name: Changelog Updater

on:
release:
types:
types:
- released

jobs:
Expand All @@ -23,6 +23,6 @@ jobs:
- name: Commit updated Changelog
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
branch: test
commit_message: 'docs(changelog): update changelog'
file_pattern: CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Label Checker
name: PR Label Checker

on:
pull_request:
Expand All @@ -15,21 +15,21 @@ concurrency:

jobs:
check_semver_labels:
name: Check Semver labels
runs-on: [ self-hosted ]
name: Check Semver Label is Used
runs-on: ubuntu-latest

steps:
- name: Check for Semver labels
uses: danielchabr/pr-labels-checker@v3.1
- uses: danielchabr/pr-labels-checker@v3.1
with:
hasSome: major,minor,patch
githubToken: ${{ secrets.GITHUB_TOKEN }}

check_cc_labels:
name: Check conventional commits labels
runs-on: [ self-hosted ]
name: Check Conventional Commits Label is Used
runs-on: ubuntu-latest

steps:
- uses: danielchabr/pr-labels-checker@v3.1
with:
hasSome: feat,feature,enhancement,fix,bug,changed,deprecated,removed,security,docs,deps,dependencies
hasSome: feature,enhancement,fix,changes,performance,devops,test,deprecates,removes,security,docs,dependencies # should match keys of .github/pr-labeler.yaml
githubToken: ${{ secrets.GITHUB_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/pr-labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: PR Labeler
on:
pull_request:
types: [opened]

permissions:
contents: read

jobs:
pr-labeler:
permissions:
contents: read # for TimonVS/pr-labeler-action to read config file
pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR
runs-on: ubuntu-latest

steps:
- uses: TimonVS/pr-labeler-action@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value
6 changes: 3 additions & 3 deletions .github/workflows/pr-title-checker.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check PR title
name: PR Title Checker

on:
pull_request:
Expand All @@ -14,8 +14,8 @@ concurrency:

jobs:
title-checker:
name: Check PR title
runs-on: [ self-hosted ]
name: Check Conventional Commit Title is Used
runs-on: ubuntu-latest

steps:
- uses: aslafy-z/conventional-pr-title-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release Drafter
on:
push:
branches:
- feat/release-notes
- main

jobs:
update_release_draft:
Expand Down

0 comments on commit 9147139

Please sign in to comment.