diff --git a/.github/workflows/automerge-dependabot.yml b/.github/workflows/automerge-dependabot.yml index aab7f0b..5629669 100644 --- a/.github/workflows/automerge-dependabot.yml +++ b/.github/workflows/automerge-dependabot.yml @@ -1,21 +1,38 @@ - name: automerge +name: automatically merge dependabot PR's +on: + pull_request: + branches: [ master ] - on: - pull_request: - types: - - opened - - synchronize - - reopened - - ready_for_review +jobs: + run-unit-test: + name: run unit test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - jobs: - automerge: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 - - name: Automerge - uses: "ahmadnassri/action-dependabot-auto-merge@v2" - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: run unit tests + run: echo "unit test passed" + + auto-merge-dependabot: + name: 🤖 Auto merge dependabot PR + timeout-minutes: 10 + needs: [ run-unit-test ] + if: ${{ github.actor == 'dependabot[bot]' }} + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + steps: + - name: 🤖 Merge PR from dependabot + uses: ahmadnassri/action-dependabot-auto-merge@v2.6.6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + target: minor + merge-method: rebase