Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dragonraid/changelog-emitter

Creates changelog out of pull-request's titles
https://github.com/dragonraid/changelog-emitter

changelog github

Last synced: 13 days ago
JSON representation

Creates changelog out of pull-request's titles

Awesome Lists containing this project

README

        

# Changelog emitter

This github action fetches titles of pull requests between latest release and branch's HEAD and creates changelog from them.

## Inputs

| Input | Description | Example | Default | Required |
| :----------- | ----------------------------------------: | ------------------: | ---------------------------------------------------------: | -------: |
| github_token | github personal access token | `ghe_xyz` | **NO DEFAULT PROVIDED** | yes |
| branch | base branch of pull request | `main` | repositories default branch | no |
| title | changelog title | `Changelog` | date `YYYY/MM/DD` | no |
| prefix | prefix of pull request title in changelog | `*` | `-` | no |
| owner | owner or organization of repository | `dragonraid` | `GITHUB_REPOSITORY` environment variable (part before `/`) | no |
| repo | repository | `changelog-emitter` | `GITHUB_REPOSITORY` environment variable (part after `/`) | no |

## Output

| Output | Description |
| :-------- | ---------------------------------: |
| changelog | text of changelog |
| isEmpty | whether text of changelog is empty |

Text of changelog can also be accessed in subsequent steps via `CHANGELOG` environment variable.

## Example

This example, together with other useful github actions, creates new release with pull requests titles as release's body.

```yaml
name: release

on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Create changelog
id: changelog
uses: dragonraid/changelog-emitter
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Bump tag
if: steps.changelog.outputs.isEmpty == false
id: tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: main
default_bump: minor

- name: Create github release
if: steps.changelog.outputs.isEmpty == false
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: `${{ steps.tag.outputs.new_tag }}`,
name: `${{ steps.tag.outputs.new_tag }}`,
body: `${{ steps.changelog.outputs.changelog }}`,
});
```