Skip to content

Commit 3bb3709

Browse files
jzheauxfmbenhassine
authored andcommitted
Use spring-io/github-changelog-generator
This commit replaces downloading and running the github-changelog-generator jar with its corresponding GitHub Action. It also pulls out the change log configuration into a file committed separating from the workflow steps and favors SHA hashes for the version numbers. Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
1 parent c76b89b commit 3bb3709

3 files changed

Lines changed: 45 additions & 40 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Create Release Notes
2+
description: 'Create the release notes for a given milestone'
3+
inputs:
4+
milestone:
5+
description: 'Name of the GitHub milestone for which release notes will be created'
6+
required: true
7+
token:
8+
description: 'Token to use for authentication with GitHub'
9+
required: true
10+
runs:
11+
using: composite
12+
steps:
13+
- name: Set up JDK 25
14+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
15+
with:
16+
java-version: '25'
17+
distribution: 'temurin'
18+
- name: Generate release notes
19+
uses: spring-io/github-changelog-generator@c247eb874a8bbc2c7b91ed7227d8eb66eb639d38 # v0.0.13
20+
with:
21+
milestone: ${{ inputs.milestone }}
22+
token: ${{ inputs.token }}
23+
- name: Print release notes
24+
shell: bash
25+
run: cat changelog.md
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
changelog:
2+
repository: spring-projects/spring-batch
3+
sections:
4+
- title: ":star: New features"
5+
labels: [ "type: feature" ]
6+
- title: ":rocket: Enhancements"
7+
labels: [ "type: enhancement" ]
8+
- title: ":lady_beetle: Bug fixes"
9+
labels: [ "type: bug" ]
10+
- title: ":notebook_with_decorative_cover: Documentation"
11+
labels: [ "in: documentation" ]
12+
- title: ":hammer: Tasks"
13+
labels: [ "type: task" ]

.github/workflows/release-notes-generation.yml

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,16 @@ on:
66
milestoneNumber:
77
description: "Milestone title"
88
required: true
9-
generatorVersion:
10-
description: "Changelog Generator version"
11-
required: true
129

1310
jobs:
14-
build:
11+
generate-release-notes:
1512
name: Generate release notes
1613
runs-on: ubuntu-latest
1714
steps:
18-
- name: Capture milestone number and generator version
19-
run: |
20-
echo MILESTONE_NUMBER=${{ github.event.inputs.milestoneNumber }} >> $GITHUB_ENV
21-
echo GENERATOR_VERSION=${{ github.event.inputs.generatorVersion }} >> $GITHUB_ENV
22-
23-
- name: Download changelog generator
24-
run: wget https://github.com/spring-io/github-changelog-generator/releases/download/v$GENERATOR_VERSION/github-changelog-generator.jar
25-
26-
- name: Set up JDK 25
27-
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
28-
with:
29-
java-version: '25'
30-
distribution: 'temurin'
31-
32-
- name: Prepare configuration file
33-
run: |
34-
cat << EOF > application.yml
35-
changelog:
36-
repository: spring-projects/spring-batch
37-
sections:
38-
- title: ":star: New features"
39-
labels: [ "type: feature" ]
40-
- title: ":rocket: Enhancements"
41-
labels: [ "type: enhancement" ]
42-
- title: ":lady_beetle: Bug fixes"
43-
labels: [ "type: bug" ]
44-
- title: ":notebook_with_decorative_cover: Documentation"
45-
labels: [ "in: documentation" ]
46-
- title: ":hammer: Tasks"
47-
labels: [ "type: task" ]
48-
EOF
49-
15+
- name: Check Out Code
16+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5017
- name: Generate release notes
51-
run: java -jar github-changelog-generator.jar $MILESTONE_NUMBER release-notes.md
52-
53-
- name: Print release notes
54-
run: cat release-notes.md
18+
uses: ./.github/actions/create-release-notes
19+
with:
20+
milestone: ${{ inputs.milestoneNumber }}
21+
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}

0 commit comments

Comments
 (0)