Giter Site home page Giter Site logo

ecampidoglio / auto-release-draft Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 5.0 3.04 MB

:octocat::pencil: Drafts a GitHub release with the changes introduced by a newly created version tag.

Home Page: https://www.pluralsight.com/courses/building-custom-github-actions

License: MIT License

TypeScript 98.70% JavaScript 1.30%
github-actions javascript-action release-automation release-notes pluralsight

auto-release-draft's Introduction

Auto Release Draft

A GitHub action that automatically drafts a GitHub release based on a newly created version tag.

The commit messages between the created version tag and the one that came before it will become the release notes.

Here's an example. Let's assume the history of your repository looks like this:

    ┌────┐      ╔════╗
    │ v1 │      ║ v2 ║           # Release Notes
    └────┘      ╚════╝
       │           │     ━━━━▶   - D
       ▼           ▼             - C
 A ─ ─ B ─ ─ C ─ ─ D

Here, v2 is the last created version tag. When auto-release-draft runs, it will draft a release with the commit messages for C and D as the release notes.

If the created version tag is the first one in the repository, then all commit messages from the beginning of the repository's history will be included in the release notes:

                ╔════╗           # Release Notes
                ║ v1 ║
                ╚════╝           - D
                   │     ━━━━▶   - C
                   ▼             - B
 A ─ ─ B ─ ─ C ─ ─ D             - A

In this case, the release notes will contain the messages for A, B, C and D.

A version tag is an annotated tag whose name starts with the prefix v followed by one or more characters. This means v1, v.1, v1.0.0 and v1.0.0-beta1 are all valid version tags. If you don't know which versioning scheme to adopt for your project, Semantic Versioning is a very good choice.

Inputs

repo-token

(Required) The GITHUB_TOKEN used to access the current repository from the GitHub REST API.

Outputs

release-url

The URL of the GitHub release that was drafted. Defaults to an empty string.

Usage

Here's an example of a workflow that listens for the create event and automatically creates a release draft with the commit messages as release notes. It also prints the URL of the release page to the build log.

name: Test
on:
  create:
jobs:
  release:
    name: Release
    runs-on: ubuntu-latest
    steps:
      - name: Create a release draft for a version tag
        id: create-release-draft
        uses: ecampidoglio/auto-release-draft@v1
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
      - name: Print the URL of the release draft
        if: steps.create-release-draft.outputs.release-url != ''
        run: echo ${{ steps.create-release-draft.outputs.release-url }}

auto-release-draft's People

Contributors

dependabot[bot] avatar ecampidoglio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

auto-release-draft's Issues

[Security] Workflow build.yml is using vulnerable action actions/checkout

The workflow build.yml is referencing action actions/checkout using references v1. However this reference is missing the commit a6747255bd19d7a757dbdda8c654a9f84db19839 which may contain fix to the some vulnerability.
The vulnerability fix that is missing by actions version could be related to:
(1) CVE fix
(2) upgrade of vulnerable dependency
(3) fix to secret leak and others.
Please consider to update the reference to the action.

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.