Skip to content

Commit 0a2ced2

Browse files
committed
Update GitHub workflows
1 parent 89d44ae commit 0a2ced2

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

.github/workflows/auto-merge.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Dependabot auto-merge
2+
on: pull_request
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
if: ${{ github.actor == 'dependabot[bot]' }}
12+
steps:
13+
- name: Dependabot metadata
14+
id: metadata
15+
uses: dependabot/[email protected]
16+
with:
17+
github-token: "${{ secrets.GITHUB_TOKEN }}"
18+
- name: Enable auto-merge for Dependabot PRs
19+
run: gh pr merge --auto --merge "$PR_URL"
20+
env:
21+
PR_URL: ${{github.event.pull_request.html_url}}
22+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/main.yml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Main
22
on:
33
- push
4-
- pull_request_target
4+
- pull_request
55
jobs:
66
# Ensure that the distributables compile with esbuild (since tests use tsc)
77
build:
@@ -117,20 +117,3 @@ jobs:
117117
start-stop-daemon --stop --pidfile ~/var/run/Xvfb.pid
118118
kill $DBUS_SESSION_BUS_PID
119119
if: always() && runner.os == 'Linux'
120-
# Merge green PRs automatically if they come from repository owner or Dependabot
121-
automerge:
122-
name: AutoMerge
123-
needs:
124-
- build
125-
- test
126-
runs-on: ubuntu-latest
127-
if: github.event_name == 'pull_request_target' && (github.actor == github.repository_owner || github.actor == 'dependabot[bot]')
128-
steps:
129-
- uses: actions/github-script@v6
130-
with:
131-
script: |
132-
github.pulls.merge({
133-
owner: context.payload.repository.owner.login,
134-
repo: context.payload.repository.name,
135-
pull_number: context.payload.pull_request.number
136-
})

0 commit comments

Comments
 (0)