From 27af6ddaad2e1bda1747fc7f220b5d8a21d0b093 Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Thu, 21 Jan 2021 09:20:17 +0530 Subject: [PATCH 1/8] adds release notes action --- release-notes/action.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 release-notes/action.yml diff --git a/release-notes/action.yml b/release-notes/action.yml new file mode 100644 index 0000000..67908a9 --- /dev/null +++ b/release-notes/action.yml @@ -0,0 +1,13 @@ +name: 'Release notes action' +description: 'standardizes the CLI flags for gradle' +inputs: + gren-github-token: # Replaces $HELM_GCS_REPOSITORY env var. Assumes only one or other is set + description: 'GitHub token for Gren' + required: false +runs: + using: "composite" + steps: + - run: npx gren release --data-source=commits --override + shell: bash + env: + GREN_GITHUB_TOKEN: ${{ inputs.gren-github-token }} From 466ced350a21636f4006fad4b247ff0848f9e108 Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Thu, 21 Jan 2021 19:43:05 +0530 Subject: [PATCH 2/8] cleanup --- release-notes/.grenrc.js | 44 ++++++++++++++++++++++++++++++++++++++++ release-notes/action.yml | 4 +++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 release-notes/.grenrc.js diff --git a/release-notes/.grenrc.js b/release-notes/.grenrc.js new file mode 100644 index 0000000..6474ccd --- /dev/null +++ b/release-notes/.grenrc.js @@ -0,0 +1,44 @@ +module.exports = { + "dataSource": "prs", + "prefix": "", + "onlyMilestones": false, + "ignoreIssuesWith": ["no-release", "wontfix", "question"], + "ignoreTagsWith": ["-rc", "-alpha", "-beta", "test", "current"], + "ignoreLabels": ["closed", "automation", "enhancement", "bug", "fix", + "internal", "feature", "feat", "docs", "chore", "refactor", "ci", + "perf", "test", "tests", "style", "linux"], + "groupBy": { + "Enhancements": ["enhancement", "internal", "feature", "feat"], + "Bug Fixes": ["bug", "fix"], + "Documentation": ["docs", "question"], + "Minor Fixes": ["chore", "refactor", "perf", "test", "style"], + "Config": ["config", "helm"], + "CI": ["ci"] + }, + "template": { + commit: ({ message, url, author, name }) => `- [${message}](${url}) - ${author ? `@${author}` : name}`, + issue: "- {{labels}} {{name}} [{{text}}]({{url}})", + label: "[**{{label}}**]", + noLabel: "closed", + changelogTitle: "# Changelog\n\n", + release: "## {{release}} ({{date}})\n{{body}}", + releaseSeparator: "\n---\n\n", + group: function (placeholders) { + var icon = "🙈" + if(placeholders.heading == 'Enhancements'){ + icon = "🚀" + } else if(placeholders.heading == 'Bug Fixes'){ + icon = "🐛" + } else if(placeholders.heading == 'Documentation'){ + icon = "📚" + } else if(placeholders.heading == 'Minor Fixes'){ + icon = "❗" + } else if(placeholders.heading == 'Config'){ + icon = "⚙️" + } else if(placeholders.heading == 'CI'){ + icon = "⚡" + } + return '\n#### ' + icon + ' ' + placeholders.heading + '\n'; + } + } +} \ No newline at end of file diff --git a/release-notes/action.yml b/release-notes/action.yml index 67908a9..adc797c 100644 --- a/release-notes/action.yml +++ b/release-notes/action.yml @@ -7,7 +7,9 @@ inputs: runs: using: "composite" steps: - - run: npx gren release --data-source=commits --override + - run: | + npm install github-release-notes@0.17.3 -g + GREN_GITHUB_TOKEN=$GITHUB_TOKEN gren release --username=$username --repo=$repository -c .grenrc.js --override shell: bash env: GREN_GITHUB_TOKEN: ${{ inputs.gren-github-token }} From dd4c721ede875c15d33dbd13a272a990bb41eb7c Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Thu, 21 Jan 2021 19:50:21 +0530 Subject: [PATCH 3/8] test --- release-notes/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/action.yml b/release-notes/action.yml index adc797c..82488f2 100644 --- a/release-notes/action.yml +++ b/release-notes/action.yml @@ -9,7 +9,7 @@ runs: steps: - run: | npm install github-release-notes@0.17.3 -g - GREN_GITHUB_TOKEN=$GITHUB_TOKEN gren release --username=$username --repo=$repository -c .grenrc.js --override + gren release --username=$username --repo=$repository -c .grenrc.js --override shell: bash env: GREN_GITHUB_TOKEN: ${{ inputs.gren-github-token }} From ef9c719f9d485ab3c107368e831d5dd2af1f24e3 Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Thu, 21 Jan 2021 19:53:55 +0530 Subject: [PATCH 4/8] test --- release-notes/action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/release-notes/action.yml b/release-notes/action.yml index 82488f2..862aeee 100644 --- a/release-notes/action.yml +++ b/release-notes/action.yml @@ -8,8 +8,7 @@ runs: using: "composite" steps: - run: | - npm install github-release-notes@0.17.3 -g - gren release --username=$username --repo=$repository -c .grenrc.js --override + npx gren release --username=$username --repo=$repository -c .grenrc.js --override shell: bash env: GREN_GITHUB_TOKEN: ${{ inputs.gren-github-token }} From 34ab2e2c4ba713f471278b92dbbd45c7d36002f7 Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Thu, 21 Jan 2021 20:28:41 +0530 Subject: [PATCH 5/8] uses docker action --- release-notes/Dockerfile | 10 ++++++++++ release-notes/action.yml | 20 +++++++++----------- release-notes/entrypoint.sh | 7 +++++++ 3 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 release-notes/Dockerfile create mode 100644 release-notes/entrypoint.sh diff --git a/release-notes/Dockerfile b/release-notes/Dockerfile new file mode 100644 index 0000000..c61dc6c --- /dev/null +++ b/release-notes/Dockerfile @@ -0,0 +1,10 @@ +FROM node:12-alpine +ENV GREN_VERSION 0.17.3 +RUN apk add --update git && \ + npm install github-release-notes@$GREN_VERSION -g + +COPY entrypoint.sh /entrypoint.sh + +COPY .grenrc.js /.grenrc.js + +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/release-notes/action.yml b/release-notes/action.yml index 862aeee..cdef6f6 100644 --- a/release-notes/action.yml +++ b/release-notes/action.yml @@ -1,14 +1,12 @@ -name: 'Release notes action' -description: 'standardizes the CLI flags for gradle' +name: "GitHub Release Notes" +description: "GitHub release notes and changelog generator using Gren" inputs: - gren-github-token: # Replaces $HELM_GCS_REPOSITORY env var. Assumes only one or other is set - description: 'GitHub token for Gren' + options: # Add the gren options here + description: 'Add the gren options here; e.g. " --override --prerelease"' required: false + default: '-c .grenrc.js --override' runs: - using: "composite" - steps: - - run: | - npx gren release --username=$username --repo=$repository -c .grenrc.js --override - shell: bash - env: - GREN_GITHUB_TOKEN: ${{ inputs.gren-github-token }} + using: "docker" + image: "Dockerfile" + args: + - ${{ inputs.options }} \ No newline at end of file diff --git a/release-notes/entrypoint.sh b/release-notes/entrypoint.sh new file mode 100644 index 0000000..b8658d9 --- /dev/null +++ b/release-notes/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh -l + +IFS='/' read -r username repository < Date: Thu, 21 Jan 2021 20:30:44 +0530 Subject: [PATCH 6/8] chmod --- release-notes/entrypoint.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 release-notes/entrypoint.sh diff --git a/release-notes/entrypoint.sh b/release-notes/entrypoint.sh old mode 100644 new mode 100755 From c2ce965c9a4274bf83db01415a5ec656db230d44 Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Thu, 21 Jan 2021 20:44:53 +0530 Subject: [PATCH 7/8] Update entrypoint.sh --- release-notes/entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-notes/entrypoint.sh b/release-notes/entrypoint.sh index b8658d9..54c8d2d 100755 --- a/release-notes/entrypoint.sh +++ b/release-notes/entrypoint.sh @@ -3,5 +3,5 @@ IFS='/' read -r username repository < Date: Thu, 21 Jan 2021 20:54:38 +0530 Subject: [PATCH 8/8] Update entrypoint.sh --- release-notes/entrypoint.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/release-notes/entrypoint.sh b/release-notes/entrypoint.sh index 54c8d2d..ca44f4e 100755 --- a/release-notes/entrypoint.sh +++ b/release-notes/entrypoint.sh @@ -3,5 +3,4 @@ IFS='/' read -r username repository <