mirror of
https://github.com/s4u/maven-settings-action.git
synced 2026-02-18 00:00:26 +08:00
File sync from s4u/.github - Auto Approve by gh cli
This commit is contained in:
35
.github/workflows/auto-approve.yml
vendored
35
.github/workflows/auto-approve.yml
vendored
@ -1,25 +1,38 @@
|
|||||||
name: Auto approve
|
name: Auto Approve
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request_target
|
pull_request_target
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
auto-approve:
|
auto-approve:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: alexwilson/enable-github-automerge-action@1.0.0
|
- name: Dependabot metadata
|
||||||
if: >
|
if: github.actor == 'dependabot[bot]'
|
||||||
github.actor == 'dependabot[bot]'
|
id: dependabot-metadata
|
||||||
|| github.actor == 'dependabot-preview[bot]'
|
uses: dependabot/fetch-metadata@v1.1.1
|
||||||
with:
|
with:
|
||||||
merge-method: "REBASE"
|
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
github-token: "${{ secrets.TECH_TOKEN }}"
|
|
||||||
|
|
||||||
- uses: hmarr/auto-approve-action@v2.1.0
|
- name: Enable auto-merge for Dependabot PRs
|
||||||
|
if: >
|
||||||
|
github.actor == 'dependabot[bot]'
|
||||||
|
&& steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch'
|
||||||
|
run: gh pr merge --auto --rebase "$PR_URL"
|
||||||
|
env:
|
||||||
|
PR_URL: ${{github.event.pull_request.html_url}}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Approve a PR
|
||||||
if: >
|
if: >
|
||||||
github.actor == 'dependabot[bot]'
|
github.actor == 'dependabot[bot]'
|
||||||
|| github.actor == 'dependabot-preview[bot]'
|
|
||||||
|| github.actor == 'slawekjaranowski'
|
|| github.actor == 'slawekjaranowski'
|
||||||
with:
|
run: gh pr review --approve "$PR_URL"
|
||||||
github-token: "${{ secrets.TECH_TOKEN }}"
|
env:
|
||||||
|
PR_URL: ${{github.event.pull_request.html_url}}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user