name: Version bump and create PR for changes

on:
  # Trigger the workflow on push only for the master branch
  push:
    branches:
      - master

env:
  NODE_ENV: 'development'

jobs:
  update_changelog:
    runs-on: ubuntu-20.04
    # Dont run if we're on a release commit
    if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: '0'
      - name: Bump Version
        uses: maidsafe/rust-version-bump-branch-creator@v2
        with:
          token: ${{ secrets.BRANCH_CREATOR_TOKEN }}