Automatically update your CHANGELOG.md for a new release
Go to file
Thomas Eizinger 8f254ca247 Initial commit 2020-02-15 13:26:26 +08:00
__tests__ Initial commit 2020-02-15 13:26:26 +08:00
dist Initial commit 2020-02-15 13:26:26 +08:00
src Initial commit 2020-02-15 13:26:26 +08:00
types/to-vfile Initial commit 2020-02-15 13:26:26 +08:00
.eslintignore Initial commit 2020-02-15 13:26:26 +08:00
.eslintrc.json Initial commit 2020-02-15 13:26:26 +08:00
.gitignore Initial commit 2020-02-15 13:26:26 +08:00
.prettierignore Initial commit 2020-02-15 13:26:26 +08:00
LICENSE Initial commit 2020-02-15 13:26:26 +08:00
README.md Initial commit 2020-02-15 13:26:26 +08:00
action.yml Initial commit 2020-02-15 13:26:26 +08:00
jest.config.js Initial commit 2020-02-15 13:26:26 +08:00
package.json Initial commit 2020-02-15 13:26:26 +08:00
tsconfig.json Initial commit 2020-02-15 13:26:26 +08:00
webpack.config.js Initial commit 2020-02-15 13:26:26 +08:00
yarn.lock Initial commit 2020-02-15 13:26:26 +08:00

README.md

Git Flow releases using GitHub actions

This GitHub action helps you in automating a Git Flow like release process.

What does it do for me?

This action is designed to listen on the IssueEvent "opened". Given an issue with the title "Release version x.y.z", the action will branch of a release branch from the current development branch, update the changelog according to the new version and open a pull request against master.

Getting started

Define a new workflow like this:

name: "Create a release PR"
on:
  issues: opened

jobs:
  create-release-pr:
    runs-on: ubuntu-latest
    if: startsWith(github.event.issue.title, "Release version") # only run for issues with a specific title
    steps:
    - uses: actions/checkout@v2
    
    - name: Extract version from issue title
      run: |
        TITLE=${{ github.event.issue.title }} 
        VERSION=${TITLE#Release version }
        
        echo "::set-env name=RELEASE_VERSION::$VERSION"        
    
    - name: Create release branch
      run: git checkout -b release/${{ env.RELEASE_VERSION }}
      
    - name: Update changelog
      uses: thomaseizinger/update-changelog-for-release@v1
      with:
        version: ${{ env.RELEASE_VERSION }}

    # This step will differ depending on your project setup
    - name: Bump version in package.json
      run: yarn version --new-version ${{ env.RELEASE_VERSION }}
    
    - name: Commit changelog and manifest files
      run: |
        git add CHANGELOG.md package.json
        git commit --message "Prepare release ${{ env.RELEASE_VERSION }}"        
    
    - name: Push new branch
      run: git push origin release/${{ env.RELEASE_VERSION }}
    
    - name: Create pull request
      uses: thomaseizinger/create-pull-request@v1
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
        branch: release/${{ env.RELEASE_VERSION }}
        base: master
        reviewers: ${{ github.event.issue.user.login }}
        body: |
          Resolves #${{ github.event.issue.number }}