ci: update changelog generation to script (#1589)

This commit is contained in:
Travis Groth 2020-11-12 20:00:07 -05:00 committed by GitHub
parent f604a3e87a
commit 095eb63a21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 47 deletions

View file

@ -1,31 +0,0 @@
name-template: v$NEXT_MINOR_VERSION
tag-template: v$NEXT_MINOR_VERSION
categories:
- title: New
labels:
- enhancement
- feature
- improvement
- title: Fixed
label: bug
- title: Removed
label: removed
- title: Documentation
label: docs
- title: Dependency
label: dependency
- title: Breaking
label: breaking
exclude-labels:
- no-changelog
change-template: "- $TITLE @$AUTHOR GH-$NUMBER"
template: |
<!-- Optional: add a release summary here -->
## Changes
$CHANGES
replacers:
- search: '/CVE-(\d{4})-(\d+)/g'
replace: "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-$1-$2"

View file

@ -1,16 +0,0 @@
name: Release Drafter
on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master
jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: toolmantim/release-drafter@v5.12.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

27
scripts/changelog.sh Executable file
View file

@ -0,0 +1,27 @@
#!/bin/bash
SINCE=$1
RELEASE=$2
BRANCH="${3:-$(git branch --show-current)}"
OUTFILE=$4
docker run --rm=true -it -v "$(pwd)":/usr/local/src/your-app ferrarimarco/github-changelog-generator \
--user pomerium --project pomerium \
-o "${OUTFILE}" \
--no-issues \
--max-issues 500 \
--usernames-as-github-logins \
--release-branch "${BRANCH}" \
--future-release "${RELEASE}" \
--since-tag "${SINCE}" \
--token "${GITHUB_TOKEN}" \
--breaking-label "## Breaking" \
--enhancement-label "## New" \
--bugs-label "## Fixed" \
--pr-label "## Changed" \
--deprecated-label "## Deprecated" \
--removed-label "## Removed" \
--security-label "## Security" \
--cache-file /usr/local/src/your-app/.cache \
--enhancement-labels "improvement,Improvement, enhancement,Enhancement, feature" \
--add-sections '{"documentation":{"prefix":"## Documentation","labels":["docs"]}, "dependency":{"prefix":"## Dependency","labels":["dependency"]}, "deployment":{"prefix":"## Deployment","labels":["deployment"]}}'