Skip to content

Commit

Permalink
Merge pull request #13 from Decathlon/feat_release_notes_configuration
Browse files Browse the repository at this point in the history
feat: YML file to configure release notes tags
  • Loading branch information
mmornati authored May 28, 2020
2 parents 8834808 + 4b6ec74 commit 6f8662e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .github/release-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
releasenotes:
sections:
- title: "Enhancements"
emoji: ":star:"
labels: ["new"]
- title: "Bugs"
emoji: ":beetle:"
labels: ["fix"]

15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,21 @@ Creating release notes for Milestone 1 into the Sprint_10.md file
### SUCCEEDED Create Release Notes 15:53:53Z (15.913s)
```

## Section configuration
You can manage the sections and how they are used by the release generator, creating the `.github/release-notes.yml` file in the repository where you activate the action.
An example of file content (you can find detaild information direactly on the [Spring repository](https://github.com/spring-io/github-release-notes-generator))
```
releasenotes:
sections:
- title: "Enhancements"
emoji: ":star:"
labels: ["new"]
- title: "Bugs"
emoji: ":beetle:"
labels: ["fix"]
```
In the sections list you can configure each seaction with an emoji and a list of labels to take care of for this section.
## How to use the generated file
The idea is to keep the control about what to do with the release notes file.
So simply link a new action and: send it by mail, push it on your website, on the github wiki, ...
Expand Down
6 changes: 1 addition & 5 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
name: Release notes generator
author: Decathlon <[email protected]>
description: This Github action <strong>automatically creates a release notes</strong> when a milestone is closed.
Each time a milestone is closed, this GitHub action scans its attached issues and pull requests, then automatically generates a wonderful release note.
<p align="center">
<img src="https://github.com/Decathlon/release-notes-generator-action/raw/master/images/release_notes.png" alt="Example illustration"/>
</p>
runs:
using: 'docker'
image: 'docker://decathlon/release-notes-generator-action:2.0.1'
image: 'docker://decathlon/release-notes-generator-action:2.1.0'
branding:
icon: tag
color: blue
10 changes: 10 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,23 @@ else
mkdir $OUTPUT_FOLDER
fi

echo "Checking for custom configuration..."
CONFIG_FILE=".github/release-notes.yml"
if [[ ! -f ${CONFIG_FILE} ]]; then
echo "No config file specified."
CONFIG_FILE=""
else
echo "Configuring the action using $CONFIG_FILE"
fi

if [[ "$ACTION" == "$TRIGGER_ACTION" ]]; then
echo "Creating release notes for Milestone $MILESTONE_NUMBER into the $OUTPUT_FILENAME file"
java -jar /github-release-notes-generator.jar \
--releasenotes.github.organization=${OWNER_ID} \
--releasenotes.github.repository=${REPOSITORY_NAME} \
--releasenotes.github.username=${GH_USERNAME} \
--releasenotes.github.password=${GITHUB_TOKEN} \
--spring.config.location=${CONFIG_FILE} \
${MILESTONE_NUMBER} \
${OUTPUT_FOLDER}/${OUTPUT_FILENAME}
cat ${OUTPUT_FOLDER}/${OUTPUT_FILENAME}
Expand Down

0 comments on commit 6f8662e

Please sign in to comment.