name: Go

on:
  push:
    branches: [ develop ]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - name: Get Go version from go.mod
      run: |
        go_version=$(cat go.mod | grep "^go" | cut -d ' ' -f 2)
        echo "go_version=${go_version}" >> $GITHUB_ENV

    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: ${{ env.go_version }}

    - name: Build
      run: go build -v ./...

    - name: Test
      run: go test -v ./...

  promote:
    needs: test
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        # fetch-depth: Number of commits to fetch. 0 indicates all history for all branches and tags.
        fetch-depth: 0
    - name: Promote to master
      run: |
        git fetch --all

        git checkout master
        git pull --rebase

        git rebase develop
        git push

name: Go

on:
  push:
    branches: [ develop ]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - name: Get Go version from go.mod
      run: |
        go_version=$(cat go.mod | grep "^go" | cut -d ' ' -f 2)
        echo "go_version=${go_version}" >> $GITHUB_ENV

    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: ${{ env.go_version }}

    - name: Build
      run: go build -v ./...

    - name: Test
      run: go test -v ./...

Remove promote-to-mater from GH Action
Remove promote-to-mater from GH Action
