name: Merge dev to master

on:
  workflow_run:
    workflows: [aws]
    types:
      - completed

jobs:
  pull_request:
    if: github.event.workflow_run.conclusion == 'success'
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: pull-request
      uses: repo-sync/pull-request@v2
      with:
        source_branch: "dev"
        destination_branch: "master"
        pr_title: "Automatic PR dev->master"
        pr_body: "AWS tests passed. `dev` branch can be merged to `master`."
        pr_reviewer: "davideschiavone"
        pr_allow_empty: true
        github_token: ${{ secrets.GITHUB_TOKEN }}
