Skip to content

Commit

Permalink
chore(ci): update release-notes workflow configurations (#845)
Browse files Browse the repository at this point in the history
* Improve the `release-drafter.yml` configuraiton file
* Add `pull_request` event is for autolabeler
* Add pull_request_target event for autolabeler to support PRs from forks
  • Loading branch information
puneetbehl committed Mar 15, 2024
1 parent 0af8816 commit 47cf9df
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 15 deletions.
99 changes: 90 additions & 9 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,107 @@
name-template: $RESOLVED_VERSION
tag-template: v$RESOLVED_VERSION
pull-request:
title-templates:
fix: '🐛 $TITLE (#$NUMBER)'
feat: '🚀 $TITLE (#$NUMBER)'
default: '$TITLE (#$NUMBER)'
autolabeler:
- label: 'bug'
branch:
- '/fix\/.+/'
title:
- '/fix/i'
- label: 'feature'
branch:
- '/feature\/.+/'
title:
- '/feat/i'
- label: 'documentation'
branch:
- '/docs\/.+/'
title:
- '/docs/i'
- label: 'maintenance'
branch:
- '/(chore|refactor|style|test|ci|perf|build)\/.+/'
title:
- '/(chore|refactor|style|test|ci|perf|build)/i'
- label: 'chore'
branch:
- '/chore\/.+/'
title:
- '/chore/i'
- label: 'refactor'
branch:
- '/refactor\/.+/'
title:
- '/refactor/i'
- label: 'style'
branch:
- '/style\/.+/'
title:
- '/style/i'
- label: 'test'
branch:
- '/test\/.+/'
title:
- '/test/i'
- label: 'ci'
branch:
- '/ci\/.+/'
title:
- '/ci/i'
- label: 'perf'
branch:
- '/perf\/.+/'
title:
- '/perf/i'
- label: 'build'
branch:
- '/build\/.+/'
title:
- '/build/i'
- label: 'deps'
branch:
- '/deps\/.+/'
title:
- '/deps/i'
- label: 'revert'
branch:
- '/revert\/.+/'
title:
- '/revert/i'
categories:
- title: Features
- title: '🚀 Features'
labels:
- 'feat'
- "type: enhancement"
- "type: new feature"
- "type: major"
- title: 🐛 Bug Fixes/Improvements
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- "type: improvement"
- "type: bug"
- "type: minor"
- title: 🛠 Dependency upgrades
- title: '📚 Documentation'
labels:
- "type: dependency upgrade"
- "dependencies"
- title: ⚙️ Build/CI
- 'docs'
- title: '🔧 Maintenance'
labels:
- 'maintenance'
- 'chore'
- 'refactor'
- 'style'
- 'test'
- 'ci'
- 'perf'
- 'build'
- "type: ci"
- "type: build"
- title: '⏪ Reverts'
labels:
- 'revert'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
version-resolver:
major:
Expand All @@ -31,13 +114,11 @@ version-resolver:
labels:
- 'type: patch'
default: patch
commitsh: $BASE_REF_NAME
filter-by-commitsh: true
template: |
## What's Changed
$CHANGES
## Contributors
$CONTRIBUTORS
$CONTRIBUTORS
13 changes: 7 additions & 6 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ on:
types: [closed,reopened]
push:
branches:
- master
- '[7-9]+.[0-9]+.x'
pull_request:
types: [opened, reopened, synchronize]
pull_request_target:
types: [opened, reopened, synchronize]
workflow_dispatch:
jobs:
release_notes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Check if it has release drafter config file
id: check_release_drafter
run: |
Expand All @@ -21,12 +24,10 @@ jobs:
id: extract_branch
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
# If it has release drafter:
- uses: release-drafter/release-drafter@v6
- uses: release-drafter/release-drafter@v5
if: steps.check_release_drafter.outputs.has_release_drafter == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
commitish: ${{ steps.extract_branch.outputs.value }}
# Otherwise:
- name: Export Gradle Properties
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'
Expand All @@ -45,4 +46,4 @@ jobs:
name: ${{ env.title }} ${{ steps.release_notes.outputs.next_version }}
tag: v${{ steps.release_notes.outputs.next_version }}
bodyFile: CHANGELOG.md
token: ${{ secrets.GH_TOKEN }}
token: ${{ secrets.GH_TOKEN }}

0 comments on commit 47cf9df

Please sign in to comment.