Skip to content

Commit

Permalink
fix automerge job
Browse files Browse the repository at this point in the history
  • Loading branch information
aliddell committed Jun 1, 2023
1 parent b3f3865 commit 813223d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 35 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/auto-merge.yml

This file was deleted.

32 changes: 29 additions & 3 deletions .github/workflows/test_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ on:
push:
branches:
- main
pull_request:
pull_request_target:
branches:
- main

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: [self-hosted, dcam]
test:
runs-on: [ self-hosted, dcam ]
permissions:
actions: write

Expand Down Expand Up @@ -54,3 +54,29 @@ jobs:
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}} -L dcam --output-on-failure

auto-merge:
name: "Auto-merge Dependabot PRs"
needs: test
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: "Get Dependabot metadata"
id: dependabot-metadata
uses: dependabot/[email protected]
with:
github-token: ${{ github.token }}

- name: "Approve the PR"
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.PAT }}

# Don't auto-merge major version updates
- name: "Auto-merge the PR"
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.PAT }}

0 comments on commit 813223d

Please sign in to comment.