Skip to content

Commit 47be73e

Browse files
committed
ci: Update release-notes.yml
1 parent 64fc1d8 commit 47be73e

File tree

1 file changed

+11
-39
lines changed

1 file changed

+11
-39
lines changed

.github/workflows/release-notes.yml

+11-39
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,23 @@
1-
name: Changelog
1+
name: "Release Drafter"
22
on:
33
issues:
4-
types: [closed,reopened]
4+
types: [closed, reopened]
55
push:
66
branches:
7+
- master
78
- '[4-9]+.[0-9]+.x'
89
pull_request:
9-
types: [opened, reopened, synchronize, labeled]
10+
types: [opened, reopened, synchronize]
1011
pull_request_target:
11-
types: [opened, reopened, synchronize, labeled]
12+
types: [opened, reopened, synchronize]
1213
workflow_dispatch:
1314
jobs:
14-
release_notes:
15+
update_release_draft:
16+
permissions:
17+
contents: read # limit to read access
1518
runs-on: ubuntu-latest
1619
steps:
17-
- uses: actions/checkout@v3
18-
- name: Check if it has release drafter config file
19-
id: check_release_drafter
20-
run: |
21-
has_release_drafter=$([ -f .github/release-drafter.yml ] && echo "true" || echo "false")
22-
echo "has_release_drafter=${has_release_drafter}" >> $GITHUB_OUTPUT
23-
- name: Extract branch name
24-
id: extract_branch
25-
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
26-
# If it has release drafter:
27-
- uses: release-drafter/release-drafter@v5
28-
if: steps.check_release_drafter.outputs.has_release_drafter == 'true'
20+
- name: "📝 Update Release Draft"
21+
uses: release-drafter/release-drafter@v6
2922
env:
30-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
31-
with:
32-
commitish: ${{ steps.extract_branch.outputs.value }}
33-
# Otherwise:
34-
- name: Export Gradle Properties
35-
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'
36-
uses: micronaut-projects/github-actions/export-gradle-properties@master
37-
- uses: micronaut-projects/github-actions/release-notes@master
38-
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'
39-
id: release_notes
40-
with:
41-
token: ${{ secrets.GH_TOKEN }}
42-
- uses: ncipollo/release-action@v1
43-
if: steps.check_release_drafter.outputs.has_release_drafter == 'false' && steps.release_notes.outputs.generated_changelog == 'true'
44-
with:
45-
allowUpdates: true
46-
commit: ${{ steps.release_notes.outputs.current_branch }}
47-
draft: true
48-
name: "${{ env.title }} ${{ steps.release_notes.outputs.next_version }}"
49-
tag: v${{ steps.release_notes.outputs.next_version }}
50-
bodyFile: CHANGELOG.md
51-
token: ${{ secrets.GH_TOKEN }}
23+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

0 commit comments

Comments
 (0)