Skip to content

Commit

Permalink
Merge pull request #118 from alma/devx/update-release-drafter
Browse files Browse the repository at this point in the history
[DEVX] Fix branch for release-drafter + don't publish internal changes in changelog
  • Loading branch information
carine-bonnafous authored Jul 9, 2024
2 parents f4eeb80 + d0fc355 commit 21081a0
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'type: chore': ['chore/*', 'renovate/*', 'chore(deps):*']
'type: ci': ci/*
'type: perf': perf/*
'type: refator': refactor/*
'type: test': test/*
'type: docs': docs/*
'type: bugfix': ['fix/*', 'bug/*', 'hotfix-backport/*']
'type: feature': ['feature/*', 'feat/*']
'type: security': ['security/*', 'dependabot/*']
'type: hotfix': 'hotfix/*'
'type: devx': 'devx/*'
25 changes: 24 additions & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,33 @@ name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'

template: |
## Changes
$CHANGES
change-template: '- $TITLE'
### Contributors
$CONTRIBUTORS
categories:
- title: '🚀 New Features'
labels:
- 'type: feature'
- title: '🐛 Bug Fixes'
labels:
- 'type: bugfix'
- 'type: hotfix'

exclude-labels:
- 'skip-changelog'
- 'type: chore'
- 'type: ci'
- 'type: refactor'
- 'type: test'
- 'type: docs'
- 'type: security'
- 'type: devx'
change-template: '- $TITLE (#$NUMBER)'
change-title-escapes: '\<*_&#@`'
version-resolver:
major:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/backport-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ jobs:
title: Backport main to develop
branch: chore/backport-main-to-develop
base: develop
labels: skip-changelog
16 changes: 16 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: PR Labeler
on:
pull_request:
types: [opened]

jobs:
pr-labeler:
permissions:
contents: read
pull-requests: write

runs-on: ubuntu-22.04
steps:
- uses: TimonVS/pr-labeler-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 4 additions & 1 deletion .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ jobs:
- name: Publish Github release
uses: actions/github-script@v7
with:
# target_commitish is set to refs/heads/develop by release-drafter as we need to retrieve pull requests merged into develop
# We need to override it to refs/heads/main to point to the last commit of main branch instead of develop branch
script: |
const { owner, repo } = context.repo;
await github.rest.repos.updateRelease({
Expand All @@ -95,7 +97,8 @@ jobs:
release_id: "${{ steps.fetch-release-draft.outputs.id }}",
draft: false,
make_latest: true,
tag_name: "${{ steps.fetch-release-draft.outputs.name }}"
tag_name: "${{ steps.fetch-release-draft.outputs.name }}",
target_commitish: "refs/heads/main
});
- name: Format release notes for Slack
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
- name: Create release draft
uses: release-drafter/release-drafter@v6
id: release-drafter
with:
# release-drafter should be based on develop to get the correct content as pull requests are merged into develop
# Note that the target commitish of the release should be updated to refs/heads/main when published
# (Otherwise the tag will point to the last commit on develop branch instead of the last commit of main branch)
commitish: refs/heads/develop
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down

0 comments on commit 21081a0

Please sign in to comment.