Skip to content

Commit 490896a

Browse files
committed
Automerge
1 parent 12fbde1 commit 490896a

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

.github/labeler.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 1
2+
labels:
3+
- label: "automerge"
4+
authors: ["softwaremill-ci"]
5+
files:
6+
- "build.sbt"
7+
- "project/plugins.sbt"
8+
- "project/build.properties"
9+
- label: "dependency"
10+
authors: ["softwaremill-ci"]
11+
files:
12+
- "build.sbt"
13+
- "project/plugins.sbt"
14+
- "project/build.properties"

.github/workflows/bootzooka-ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,41 @@ jobs:
8989

9090
- name: Publish docker image
9191
run: sbt backend/docker:publish
92+
93+
# `automerge` label is attached iff there is exactly one file changed by steward and this file belongs to a
94+
# whitelist specified by `labeler.yml`
95+
label:
96+
name: Attach automerge label
97+
# only for PRs by softwaremill-ci
98+
if: github.event.pull_request.user.login == 'softwaremill-ci'
99+
runs-on: ubuntu-24.04
100+
steps:
101+
- uses: actions/checkout@v4
102+
with:
103+
fetch-depth: 2
104+
# count number of files changed
105+
- name: Count number of files changed
106+
id: count-changed-files
107+
run: |
108+
N=$(git diff --name-only -r HEAD^1 HEAD | wc -w)
109+
echo "changed_files_num=$N" >> $GITHUB_OUTPUT
110+
- name: Launch labeler
111+
# skip if more than one file changed
112+
if: steps.count-changed-files.outputs.changed_files_num == 1
113+
uses: srvaroa/labeler@master
114+
env:
115+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
116+
117+
auto-merge:
118+
name: Auto merge
119+
# only for PRs by softwaremill-ci
120+
if: github.event.pull_request.user.login == 'softwaremill-ci'
121+
needs: [ verify, label ]
122+
runs-on: ubuntu-24.04
123+
steps:
124+
- id: automerge
125+
name: automerge
126+
uses: "pascalgn/automerge-action@v0.15.6"
127+
env:
128+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
129+
MERGE_METHOD: "squash"

0 commit comments

Comments
 (0)