diff --git a/.github/release-notes.yml b/.github/release-notes.yml new file mode 100644 index 0000000..c8b7c23 --- /dev/null +++ b/.github/release-notes.yml @@ -0,0 +1,9 @@ +releasenotes: + sections: + - title: "Enhancements" + emoji: ":star:" + labels: ["new"] + - title: "Bugs" + emoji: ":beetle:" + labels: ["fix"] + \ No newline at end of file diff --git a/README.md b/README.md index 20d018a..82867cc 100644 --- a/README.md +++ b/README.md @@ -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, ... diff --git a/action.yml b/action.yml index b387707..ba64b1c 100644 --- a/action.yml +++ b/action.yml @@ -1,13 +1,9 @@ name: Release notes generator author: Decathlon description: This Github action automatically creates a release notes 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. -

-Example illustration -

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 diff --git a/entrypoint.sh b/entrypoint.sh index d5578f8..804e853 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -47,6 +47,15 @@ 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 \ @@ -54,6 +63,7 @@ if [[ "$ACTION" == "$TRIGGER_ACTION" ]]; then --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}