Coder Social home page Coder Social logo

changelog-gen's Introduction

CHANGELOG.md Generator

Heavily inspired by Kubernetes' release note generator.

Usage

$ export GITHUB_TOKEN=<your token>
$ changelog-gen \
  -owner terraform-providers \
  -repo terraform-provider-aws \
  441ec74e66706cc0a75d4d207724cd6460f5f6a4 \
  f3bdfeaaa7ddd9522c549e9f134948e0d698ab02

See examples for additional examples of usage and output.

The following flags are supported:

  • -github-token GitHub token, environment variable: GITHUB_TOKEN
  • -owner repository owner, environment variable: GITHUB_OWNER
  • -repo repository name, environment variable: GITHUB_NAME
  • -branch branch, defaults to master, environment variable: GITHUB_BRANCH
  • -changelog Go template for changelog generation. The model is a slice of ReleaseNote.
  • -releasenote Go template for an individual release note. The model is a single ReleaseNote.
  • -no-note-label A label that indicates PRs should not create a release note. This option may be specified multiple times, once per each label. Defaults to no-release-note and release-note-none.

In addition to flags you must also supply either 2 commit shas or 2 RFC3339 timestamps indicating the portion of the commit log to pull PRs for.

How Entries are Created

Each commit within the supplied range is has its associated PRs queried. Those PRs are check to find any who were merged with the base ref targetting the branch supplied in flags (in case PRs have been opened and closed on the same commit, or the commit was also part of a PR on a fork). PRs with the labels specified with -no-note-label are also excluded.

The unique list of PRs is then converted to release notes. For each PR, the body is checked for a section with the release note copy. The copy can appear in a few formats:

```release-note
This is an example release note!
```

```releasenote
This is also an example release note!
```

```release-note:foo
This is an example release note of foo type!
```

If no release note is found in the body, the text is taken from the PR title.

Additionally, the PR body is checked for an override author, this can used when a bot creates PRs to indicate the original author:

Original Author: @paultyng

If no author information is found, it defaults to the PR author.

Templating

Sprig is used to provide additional templating functions. See the built-in examples, or additional ones under examples.

changelog-gen's People

Contributors

paddycarver avatar paultyng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

changelog-gen's Issues

Update document to note that PR labels need to be applied

From reading the documentation, it sounds like you only need to set the release-note code block and the PR will be detected.

From looking at the code, I was able to find out that the associated Labels need to be applied to the PR as well.

Probably should add this to the documentation somewhere.

Not reading release-note block

When using the terraform-provider example changelog and release-note templates, it's not reading the release-notes block unless a variable is applied.

This uses the issue title:
```release-notes
Blah
```

This uses the block text
```release-notes:
Some text
```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.