name: Draft release
on:
  push:
    branches:
      - 'main'
jobs:
  draft:
    if: ${{ !contains(github.event.head_commit.message, 'update to latest binary release') }}
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Create draft
      run: gh release create "release-$(git rev-parse --short HEAD)" --title "Automatic release of main @ $(git rev-parse --short HEAD)"
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
