Setup dependabot automerge
This commit is contained in:
parent
9ce1163bc0
commit
7b0be18923
2 changed files with 30 additions and 2 deletions
28
.github/workflows/dependabot-automerge.yml
vendored
Normal file
28
.github/workflows/dependabot-automerge.yml
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
name: Dependabot auto merge
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: [CI]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
automerge:
|
||||||
|
name: Auto merge "${{ github.event.workflow_run.head_branch }}"
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
if: >
|
||||||
|
github.event.workflow_run.event == 'pull_request'
|
||||||
|
&& github.event.workflow_run.conclusion == 'success'
|
||||||
|
&& github.actor == 'dependabot[bot]'
|
||||||
|
&& startsWith(github.event.workflow_run.head_branch, 'dependabot/')
|
||||||
|
steps:
|
||||||
|
- name: Checkout source
|
||||||
|
uses: actions/checkout@v3.5.2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.workflow_run.head_commit.id }}
|
||||||
|
|
||||||
|
- name: Instruct @dependabot to merge
|
||||||
|
run: "gh issue comment $ISSUE_ID --body \"(This is an automated comment from workflow $WORKFLOW_URL)\n\n@dependabot squash and merge\""
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.DEPENDABOT_COMMENT_TOKEN }}
|
||||||
|
ISSUE_ID: ${{ github.event.workflow_run.pull_requests[0].number }}
|
||||||
|
WORKFLOW_URL: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}
|
4
.github/workflows/sonar.yml
vendored
4
.github/workflows/sonar.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Sonar
|
name: Sonar scan
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
|
@ -7,7 +7,7 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sonar:
|
sonar:
|
||||||
name: Sonar
|
name: Sonar scan on "${{ github.event.workflow_run.head_branch }}"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event.workflow_run.conclusion == 'success'
|
if: github.event.workflow_run.conclusion == 'success'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue