Code Monkey home page Code Monkey logo

changelog-reader-action's Introduction

Changelog Reader

changelog-reader-action status

A GitHub action to read and get data from the CHANGELOG.md file ๐Ÿš€

This action only works if your CHANGELOG.md file follows the Keep a Changelog standard for now.

Usage

Pre-requisites

Create a workflow .yml file in your repositories .github/workflows directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file.

Inputs

  • path: The path the action can find the CHANGELOG. Optional. Defaults to ./CHANGELOG.md.
  • validation_depth: Specifies how many entries to validate in the CHANGELOG.md file. Defaults to 0.
  • version: The exact version of the log entry you want to retreive or "Unreleased" for the unreleased entry. Optional. Defaults to the last version number.

Outputs

  • version: Version of the log entry found. Ex: 2.0.0.
  • date: Release date of the log entry found. Ex: 2020-08-22.
  • status: Status of the log entry found (prereleased, released, unreleased, or yanked).
  • changes: Description text of the log entry found.

Validation

Each version in the changelog is subject to validation to enforce Semantic Versioning 2.0.0 standards as well as Keep a Changelog standards and formatting. You can utilize the validation_depth input param to specify how many entries to validate. Setting the validation_depth property to 0 will disable all validation.

Example workflow - create a release from changelog

On every push to a tag matching the pattern v*, create a release using the CHANGELOG.md content. This Workflow example assumes you'll use the @actions/create-release Action to create the release step:

on:
  push:
    # Sequence of patterns matched against refs/tags
    tags:
    - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Create Release

jobs:
  build:
    name: Create Release
    runs-on: ubuntu-latest
    steps:
      - name: Get version from tag
        id: tag_name
        run: |
          echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
        shell: bash
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Get Changelog Entry
        id: changelog_reader
        uses: mindsers/changelog-reader-action@v2
        with:
          validation_depth: 10
          version: ${{ steps.tag_name.outputs.current_version }}
          path: ./CHANGELOG.md
      - name: Create/update release
        uses: ncipollo/release-action@v1
        with:
          # This pulls from the "Get Changelog Entry" step above, referencing it's ID to get its outputs object.
          # See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
          tag: ${{ steps.changelog_reader.outputs.version }}
          name: Release ${{ steps.changelog_reader.outputs.version }}
          body: ${{ steps.changelog_reader.outputs.changes }}
          prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
          draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}
          allowUpdates: true
          token: ${{ secrets.GITHUB_TOKEN }}

Contribution

Contributions to the source code of Changelog Reader Action are welcomed and greatly appreciated. For help on how to contribute in this project, please refer to How to contribute to Changelog Reader Action.

To see the project's list of awesome contributors, please refer to our Contributors Wall.

Support

Changelog Reader Action is licensed under an MIT license, which means that it's a completely free open source software. Unfortunately, Changelog Reader Action doesn't make itself. Version 2.0.0 is the next step, which will result in many late, beer-filled nights of development.

If you're using Changelog Reader Action and want to support the development, you now have the chance! Go on my GitHub Sponsor page and become my joyful sponsor!!

For more help on how to support Changelog Reader Action, please refer to The awesome people who support Changelog Reader Action.

License

The scripts and documentation in this project are released under the MIT License

changelog-reader-action's People

Contributors

alexesprit avatar allcontributors[bot] avatar andrekosak avatar dependabot[bot] avatar endormi avatar eyap53 avatar mindsers avatar nathany-copia avatar svenstaro avatar

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.