Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automerging workflow #257

Open
erichartline opened this issue Nov 20, 2020 · 0 comments
Open

Automerging workflow #257

erichartline opened this issue Nov 20, 2020 · 0 comments
Assignees

Comments

@erichartline
Copy link
Contributor

I made some changes to the automerging workflow for repositories that rely on unit tests.

name: Automerge (Dependabot)
on: [pull_request]
jobs:
  automerge:
    runs-on: ubuntu-20.04
    if: github.actor == 'dependabot[bot]'
    steps:
      - name: wait for unit tests to pass
        uses: fountainhead/[email protected]
        id: wait-for-unit-tests
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          checkName: Unit tests
          ref: ${{ github.event.pull_request.head.sha || github.sha }}
      - name: merge
        if: steps.wait-for-unit-tests.outputs.conclusion == 'success'
        uses: ridedott/[email protected]
        with:
          GITHUB_LOGIN: dependabot[bot]
          GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
          MERGE_METHOD: REBASE
          PRESET: DEPENDABOT_PATCH

First I check to make sure the PR is opened by dependabot, if not then it skips the action. Next I wait for the Unit tests job to pass. If that's successful, then I use the merge action to merge any patch updates through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants