# This workflow creates a PR with an automatically updated changelog
# Based on: https://github.com/marketplace/actions/update-changelog

name: Update changelog for release candidates

on: 
  push:
    branches:
      - "release-candidate"
jobs:
  pre-release:
    name: "Pre Release"
    runs-on: ubuntu-latest

    steps:
    - name: Update version
      id: version
      run: |
        echo "GITHUB_REF is a tag you set for the release"
        echo "Your GitHub ref: ${GITHUB_REF}"
        VERSION=`echo "${GITHUB_REF}" | cut -f 3 -d "/"`
        echo "Preparing version ${VERSION}"
        echo "__version__ = \"${VERSION}\"" > __version__.py
        echo "##[set-output name=version;]$(echo ${VERSION})"
      uses: vemel/update-changelog@0.0.1
      id: changelog
      with:
        version: ${{ steps.version.outputs.version }}

      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v2
        with:
          commit-message: Release ${{ steps.version.outputs.version }}
          labels: release, bot
          title: "Release ${{ steps.version.outputs.version }}"
          body: |
            # Release ${{ steps.version.outputs.version }}

            Merge this PR to update your version and changelog!

            ## Included Pull Requests

            ${{ steps.changelog.outputs.pulls_list_md }}

# This workflow creates a PR with an automatically updated changelog
# Based on: https://github.com/marketplace/actions/update-changelog

name: Update changelog for release candidates

on: 
  push:
    branches:
      - "release-candidate"
jobs:
  comment:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v1
        with:
          python-version: "3.8"
      - name: Update version
        id: version
        run: |
          echo "GITHUB_REF is a tag you set for the release"
          echo "Your GitHub ref: ${GITHUB_REF}"
          VERSION=`echo "${GITHUB_REF}" | cut -f 3 -d "/"`
          echo "Preparing version ${VERSION}"
          echo "__version__ = \"${VERSION}\"" > __version__.py
          echo "##[set-output name=version;]$(echo ${VERSION})"
      - uses: vemel/update-changelog@0.0.1
        id: changelog
        with:
          version: ${{ steps.version.outputs.version }}
      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v2
        with:
          commit-message: Release ${{ steps.version.outputs.version }}
          labels: release, bot
          title: "Release ${{ steps.version.outputs.version }}"
          body: |
            # Release ${{ steps.version.outputs.version }}

            Merge this PR to update your version and changelog!

            ## Included Pull Requests

            ${{ steps.changelog.outputs.pulls_list_md }}
Fix error in workflow file
Fix error in workflow file

