Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Replace mergify with automerge action #540

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 1
labels:
- label: "automerge"
authors: ["softwaremill-ci"]
files:
- "build.sbt"
- "project/plugins.sbt"
- label: "dependency"
authors: ["softwaremill-ci"]
files:
- "build.sbt"
- "project/plugins.sbt"
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,44 @@ jobs:
- name: Check MiMa # disable for major releases
run: sbt -v core3/mimaReportBinaryIssues

# `automerge` label is attached iff there is exactly one file changed by steward and this file belongs to a
# whitelist specified by `labeler.yml`
label:
name: Attach automerge label
# only for PRs by softwaremill-ci
if: github.event.pull_request.user.login == 'softwaremill-ci'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
# count number of files changed
- name: Count number of files changed
id: count-changed-files
run: |
N=$(git diff --name-only -r HEAD^1 HEAD | wc -w)
echo "changed_files_num=$N" >> $GITHUB_OUTPUT
- name: Launch labeler
# skip if more than one file changed
if: steps.count-changed-files.outputs.changed_files_num == 1
uses: srvaroa/labeler@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

auto-merge:
name: Auto merge
# only for PRs by softwaremill-ci
if: github.event.pull_request.user.login == 'softwaremill-ci'
needs: [ ci, mima, label ]
runs-on: ubuntu-22.04
steps:
- id: automerge
name: automerge
uses: "pascalgn/automerge-action@v0.16.3"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_METHOD: "squash"

publish:
name: Publish release
needs: [ci]
Expand Down
54 changes: 0 additions & 54 deletions .mergify.yml

This file was deleted.

Loading