udondan/iam-floyd

View on GitHub
.github/workflows/automerge.yml

Summary

Maintainability
Test Coverage
---
name: Automerge

concurrency: automerge

on:
  pull_request_target:
    types: [labeled, synchronize]

jobs:
  automerge_ci:
    name: Automerge CI
    runs-on: ubuntu-latest
    if: |
      github.actor == 'udondan' &&
      contains(github.event.pull_request.labels.*.name, 'automerge')
    steps:
      - name: Wait for tests to succeed
        uses: fountainhead/action-wait-for-check@v1.2.0
        id: wait-for-ci
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          checkName: Test succeeded
          ref: ${{ github.event.pull_request.head.sha || github.sha }}
          timeoutSeconds: 1200
          intervalSeconds: 30

      - name: Automerge
        uses: pascalgn/automerge-action@v0.16.4
        if: steps.wait-for-ci.outputs.conclusion == 'success'
        env:
          MERGE_LABELS: automerge
          UPDATE_LABELS: automerge
          GITHUB_TOKEN: ${{ secrets.OVERRIDE_TOKEN }}
          MERGE_DELETE_BRANCH: true