Giter Site home page Giter Site logo

changelog-action's Introduction

Changelog wit Jira links - Github Action

This GitHub Action automatically generates a changelog based on all the Conventional Commits between the latest tag and the previous tag and allows for you to link tasks to jira.

Features

  • Generates the CHANGELOG changes in Markdown format
  • Turns PR ids into links and add the PR author.
  • Turns Jira ids into links (commit message should end with #JIRA-1222 then it becomes a direct link to JIRA-1222) .
  • Prepends a shortened commit SHA ID to the commit for quick access.
  • BREAKING CHANGE notes are added at the bottom of the changelog version along with the related commit.
  • Automatically injects the changes into the CHANGELOG.md file or creates it if it doesn't exist yet. (optional)
  • Will not mess up with any header or instructions you already have at the top of your CHANGELOG.md.
  • Will not add duplicate version changes if it already exists in the CHANGELOG.md file.
  • Optionally exclude types from the CHANGELOG. (default: build,docs,other,style)

Example workflow

name: Deploy

on:
  push:
    tags:
      - v[0-9]+.[0-9]+.[0-9]+

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Code
        uses: actions/checkout@v2

      - name: Update CHANGELOG
        id: changelog
        uses: OrjanSkarnes/changelog-action@v1
        with:
          jiraBrowseUrl: # Url to jira, e.g. "https://jira.example.com/browse"
          jiraPrefixes: 'SL, SBKRESP, LPS'
          token: ${{ github.token }}
          tag: ${{ github.ref_name }}

      - name: Create Release
        uses: ncipollo/release-action@v1
        with:
          allowUpdates: true
          draft: false
          name: ${{ github.ref_name }}
          body: ${{ steps.changelog.outputs.changes }}
          token: ${{ github.token }}

      - name: Commit CHANGELOG.md
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          branch: main
          commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]'
          file_pattern: CHANGELOG.md

Inputs

  • token: Your GitHub token (e.g. ${{ github.token }}) - REQUIRED
  • tag: The latest tag which triggered the job. (e.g. ${{ github.ref_name }}) - REQUIRED
  • excludeTypes: A comma-separated list of commit types you want to exclude from the changelog (e.g. doc,chore,perf) - Optional - Default: build,docs,other,style
  • writeToFile: Should CHANGELOG.md be updated with latest changelog - Optional - Default: true
  • useGitmojis: Should type headers be prepended with their related gitmoji - Optional - Default: true
  • jiraBrowseUrl: Jira browse url you want the issues to be linked to (e.g https://jira.example.com/browse ) - Optional
  • jiraPrefixes: 'SL, SBKRESP, LPS: If you want to specify which issues that should be shown Optional (reccomended when using jiraBroserUrl)

Outputs

  • changes: Generated CHANGELOG changes for the latest tag, without the version / date header (for use in GitHub Releases).

Important

You must already have 2 tags in your repository (1 previous tag + the current latest tag triggering the job). The job will exit with an error if it can't find the previous tag!

changelog-action's People

Contributors

ngpixel avatar orjanskarnes avatar

Stargazers

 avatar

Forkers

tiborkr

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.