name: Update Pom

on:
  push:
    branches:
      - master

jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: 'Get Previous tag'
        id: previoustag
        uses: "WyriHaximus/github-action-get-previous-tag@master"
        env:
          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

      - name: 'Get next semantic versions'
        id: semvers
        uses: "WyriHaximus/github-action-next-semvers@v1"
        with:
          version: ${{ steps.previoustag.outputs.tag }}

      - name: 'Setup Java'
        uses: actions/setup-java@v1
        with:
          java-version: '11.x'
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.event.pull_request.head.sha }}
      - name: 'Update Pom'
        env:
          NEW_VERSION: ${{steps.semvers.outputs.patch}}
        run: |
          mvn --batch-mode versions:set -DnewVersion=${NEW_VERSION} -DgenerateBackupPoms=false

          CHANGED=$(git diff --name-only HEAD --)
          if [ -n "$CHANGED" ]
          then
            git config user.name oncokb-bot
            git config user.email dev.oncokb@gmail.com
            git add .
            git commit -m 'Update pom version'
            git push
          fi

Add action to update pom version
Add action to update pom version
