Skip to content

Instantly share code, notes, and snippets.

@emarref
Created May 25, 2023 01:47
Show Gist options
  • Save emarref/64a6807814fbc12bfc28ac3a4b376d80 to your computer and use it in GitHub Desktop.
Save emarref/64a6807814fbc12bfc28ac3a4b376d80 to your computer and use it in GitHub Desktop.
Nice releases
# .github/labeler.yml
# Match changes to files to apply a label
"@backend":
- apps/backend/**/*
"@frontend":
- apps/frontend/**/*
"@api":
- packages/api/**/*
"@infrastructure":
- terraform/**/*
"documentation":
- "*.md"
"workflow":
- .github/**/*
"tests":
- "**/*.spec.*"
"api":
- "/openapi.yaml"
# .github/pr-branch-labeler.yml
# Match branch names e.g. feat/... to apply a `feature` label
breaking:
head: ["breaking/*", "bc/*", "major/*"]
feature:
head: ["feat/*", "feature/*", "enhancement/*", "minor/*"]
bug:
head: ["bugfix/*", "hotfix/*", "fix/*", "bug/*"]
chore:
head: ["chore/*", "maint/*", "refactor/*"]
# .github/workflows/pr-labeler.yml
# Read .github config and apply labels to PRs based on the files that have changed or branch names.
name: "Pull Request Labeler"
on:
- pull_request
jobs:
# Apply labels based on the location of changed files, configured by .github/labeler.yml
changed_files:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
# Apply labels based on branch name, configured by .github/pr-branch-labeler.yml
branch_name:
runs-on: ubuntu-latest
steps:
- name: Label PRs
uses: ffittschen/pr-branch-labeler@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# .github/release.yml
# Describe how github should categorise release notes when creating a release, based on PR labels
changelog:
exclude:
labels:
- ignore-release
categories:
- title: Breaking Changes 🛠
labels:
- breaking
- bc
- major
- title: Exciting New Features 🎉
labels:
- feature
- enhancement
- minor
- title: Bug fixes 🪳
labels:
- bug
- bugfix
- fix
- title: Other Changes
labels:
- "*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment