Quick Release Creator - GitHub Action
Tags: actionshackathon, opensource, github, workflow
Published: 2020-09-18 05:04:59

[Instructions]: # (To submit to the GitHub Actions x DEV Hackathon, please fill out all sections.)


### My Workflow
[Note]: # (Make sure to include the name of your GitHub Action and share where it's being used!)

**Quick Release Creator** is a Github Action that lets you quickly create new releases for your github repos through a manually triggered workflow_dispatch event!

Instead of drafting a new release from scratch under the "Releases" section of a repo, Quick Release Creator provides you with a form to fill out which neatly composes a release for you.  No need to remember what exactly to include in a release or fumbling with markdown!

![action-screenshot](https://website-images-nathan.s3-us-west-2.amazonaws.com/action-screenshot.png)

You can provide specific information about your release to the action, such as:
* The version number tag
* The name/title of the release
* A brief description of major and minor changes
* Any additional notes about the release

*The major/minor changes and notes fields default to (Not noted) if that information is not provided)*

After hitting the green "Run workflow" button, the action will execute and create your new release from the information you provided!

Quick Release Creator will then output a clean looking release with the help of some simple markdown!  

*Voilà!*

Release example:
![release-screenshot](https://website-images-nathan.s3-us-west-2.amazonaws.com/release-screenshot.png)

### Submission Category: 

* Maintainer Must-Haves
* DIY Deployments


### Yaml File:

```
name: Quick Release workflow

on:
  workflow_dispatch:
    inputs:
      version-number:
        description: 'Version number tag:'
        default: 'Enter version number'
        required: true
      release-name:
        description: 'Release name:'
        default: 'Enter release name'
        required: true
      major-changes:
        description: 'Major changes:'
        default: '(No major changes noted)'
        required: false
      minor-changes:
        description: 'Minor changes:'
        default: '(No minor changes noted)'
        required: false
      notes:
        description: 'Notes:'
        default: '(No extra notes)'
        required: false

jobs:  
  build:
    name: Create Release
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Create Release
        id: create_release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: v${{ github.event.inputs.version-number }}
          release_name: ${{ github.event.inputs.release-name }}
          body: |
            ## Major changes:
            ${{ github.event.inputs.major-changes }}
            
            ## Minor changes:
            ${{ github.event.inputs.minor-changes }}
            
            ## Notes: 
            ${{ github.event.inputs.notes }}
          draft: false
          prerelease: false
```


### Additional Resources / Info

Quick Release Creator is based off the [Create a Release](https://github.com/marketplace/actions/create-a-release#example-workflow---create-a-release) GitHub action

I'm currently using my custom GitHub action in my [**Live Music PDX**](https://github.com/NathanPickard/Live-Music-PDX) application, the live music finder for Portland, Oregon!

{% github https://github.com/NathanPickard/Live-Music-PDX no-readme %}

Check it out the production version [**here**](https://d3hwbrrzu33taq.cloudfront.net/)!

**Happy coding!**