mirror of
https://github.com/suren-atoyan/monaco-react.git
synced 2026-01-25 16:02:35 +00:00
add workflow to auto-merge dependabot PRs
This commit is contained in:
parent
af59931815
commit
100bdb78f2
30
.github/workflows/auto-merge-dependabot.yml
vendored
Normal file
30
.github/workflows/auto-merge-dependabot.yml
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
name: 'Auto-merge Dependabot PRs'
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize]
|
||||
|
||||
jobs:
|
||||
dependabot:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'Check PR author'
|
||||
id: check
|
||||
run: |
|
||||
if [[ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then
|
||||
echo "::set-output name=merge::true"
|
||||
else
|
||||
echo "::set-output name=merge::false"
|
||||
fi
|
||||
|
||||
- name: 'Auto-merge Dependabot PR'
|
||||
if: steps.check.outputs.merge == 'true'
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
github.rest.pulls.merge({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.payload.pull_request.number,
|
||||
merge_method: "squash"
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user