[](https://circleci.com/gh/jk1z/gitlab-release-note-generator/tree/master) [

A Gitlab release note generator that generates release note on latest tag
- Ability to send the generated release notes to Slack
- Can be integrated as a CD service. Tutorial below
from date will be the project creation date and the to date will be that tag's creation date.api permission. How to Tutorial``shell`
docker container run -e GITLAB_PERSONAL_TOKEN=gitlabSampleToken -e GITLAB_PROJECT_ID=12345678 -e TARGET_BRANCH=sampleTargetBranch -e TARGET_TAG_REGEX=sampleRegex 00freezy00/gitlab-release-note-generator
, GITLAB_PROJECT_ID, TARGET_BRANCH(optional. Use it only if you want to find tags in the same specific branch), TARGET_TAG_REGEX (optional. Can use it to distinguish master or develop branch version bump), PUBLISH_TO_SLACK (optional) and SLACK_WEBHOOK_URL (optional) in app/env.js or feed it in process.env through npm
- npm install
- npm start
- After couple seconds, latest tag should have a release note
$3
1. Need to pass in gitlab personal access token as a CI variable
2. Need to pass in SLACK_WEBHOOK_URL as a CI variable (optional)
3. c/p the .sample.gitlab-ci.yml to your gitlab ci. What's included in the sample gitlab CI script
-
generate-release-note job. Generates a release note on the tag after detecting tag push with this regex /^[0-9]+.[0-9]+.[0-9]+(-[0-9]+)?$/
- tag-after-deployment job (optional). Tag the commit that contains a version bump with this regex /^[0-9]+.[0-9]+.[0-9]+(-[0-9]+)?$/. Require ssh key to work.
4. Customise the gitlab ci script to your needReference gitlab repo: generator test
Options
These can be specified using environment variables
* GITLAB_API_ENDPOINT: Your gitlab instance's endpoint
* Default https://gitlab.com/api/v4
* GITLAB_PERSONAL_TOKEN: Grant api read/access permission
* GITLAB_PROJECT_ID: Your project id that is located under settings > general
* TARGET_BRANCH: The branch to look for release tags (ie master)
TARGET_TAG_REGEX: Regular expression of the release tags to search (ie: ^release-.$)
* TZ: The timezone for your release notes
* Default "Australia/Melbourne"
* ISSUE_CLOSED_SECONDS: The amount of seconds to search after the last commit, useful for Merge Requests that close their tickets a second after the commit.
* Default 0
* PUBLISH_TO_SLACK: Feature flag to turn on or off publishing release notes to Slack. (optional).
* SLACK_WEBHOOK_URL: Your Slack webhook URL to send the generated release notes to Slack (optional).
Building and Running locally
`bash
export GITLAB_PERSONAL_TOKEN=MYGITLABACCESSTOKEN
export GITLAB_PROJECT_ID=99
export GITLAB_API_ENDPOINT=https://my.gitlab.com/api/v4// run docker to build my local version
docker build -t local-gitlab-release-note-generator .
// run my local version
docker container run \
-e TZ=America/New_York \
-e GITLAB_API_ENDPOINT=$GITLAB_API_ENDPOINT \
-e GITLAB_PERSONAL_TOKEN=$GITLAB_PERSONAL_TOKEN \
-e GITLAB_PROJECT_ID=$GITLAB_PROJECT_ID \
-e TARGET_BRANCH=master \
-e TARGET_TAG_REGEX=^release-.*$ \
-e PUBLISH_TO_SLACK=true \
-e SLACK_WEBHOOK_URL=$SLACK_WEBHOOK_URL \
local-gitlab-release-note-generator
``