From a7889d987fc43e35499a02910eeb69c62df4937f Mon Sep 17 00:00:00 2001 From: "bartlomiej.zylinski" Date: Mon, 6 May 2024 11:55:47 +0200 Subject: [PATCH 1/4] Rework mergify --- .github/workflows/ci.yml | 14 ++++++++++++ .mergify.yml | 49 ---------------------------------------- 2 files changed, 14 insertions(+), 49 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ab354c7..c4e61e3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,3 +132,17 @@ jobs: find $HOME/.ivy2/cache -name "*-LM-SNAPSHOT*" -delete || true find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true find $HOME/.sbt -name "*.lock" -delete || true + + 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.15.6" + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + MERGE_METHOD: "squash" \ No newline at end of file diff --git a/.mergify.yml b/.mergify.yml index 6074b01c..d916c58d 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -3,52 +3,3 @@ pull_request_rules: conditions: [] actions: delete_head_branch: {} - - name: automatic merge for softwaremill-ci pull requests affecting build.sbt - conditions: - - author=softwaremill-ci - - check-success=ci - - check-success=mima - - "#files=1" - - files=build.sbt - actions: - merge: - method: merge - - name: automatic merge for softwaremill-ci pull requests affecting project plugins.sbt - conditions: - - author=softwaremill-ci - - check-success=ci - - check-success=mima - - "#files=1" - - files=project/plugins.sbt - actions: - merge: - method: merge - - name: semi-automatic merge for softwaremill-ci pull requests - conditions: - - author=softwaremill-ci - - check-success=ci - - check-success=mima - - "#approved-reviews-by>=1" - actions: - merge: - method: merge - - name: automatic merge for softwaremill-ci pull requests affecting project build.properties - conditions: - - author=softwaremill-ci - - check-success=ci - - check-success=mima - - "#files=1" - - files=project/build.properties - actions: - merge: - method: merge - - name: automatic merge for softwaremill-ci pull requests affecting .scalafmt.conf - conditions: - - author=softwaremill-ci - - check-success=ci - - check-success=mima - - "#files=1" - - files=.scalafmt.conf - actions: - merge: - method: merge From 9ecf1eb5ed5429d10a4eb0486879ec4be978e556 Mon Sep 17 00:00:00 2001 From: "bartlomiej.zylinski" Date: Mon, 6 May 2024 11:58:57 +0200 Subject: [PATCH 2/4] Added labeler --- .github/labeler.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000..7f5cee6e --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,14 @@ +version: 1 +labels: + - label: "automerge" + authors: ["softwaremill-ci"] + files: + - "build.sbt" + - "project/plugins.sbt" + - "project/build.properties" + - label: "dependency" + authors: ["softwaremill-ci"] + files: + - "build.sbt" + - "project/plugins.sbt" + - "project/build.properties" From 3a52b9df937ab2dbe3834c182b2418f961c83e06 Mon Sep 17 00:00:00 2001 From: "bartlomiej.zylinski" Date: Mon, 6 May 2024 12:12:57 +0200 Subject: [PATCH 3/4] Add label job --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4e61e3e..c217c58d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -133,6 +133,30 @@ jobs: find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true find $HOME/.sbt -name "*.lock" -delete || true + # `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 From e5af4707f10ea11f5e6c2f84c0386d1e086f67e6 Mon Sep 17 00:00:00 2001 From: "bartlomiej.zylinski" Date: Mon, 6 May 2024 13:43:31 +0200 Subject: [PATCH 4/4] Removed mergify --- .mergify.yml | 5 ----- README.md | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 .mergify.yml diff --git a/.mergify.yml b/.mergify.yml deleted file mode 100644 index d916c58d..00000000 --- a/.mergify.yml +++ /dev/null @@ -1,5 +0,0 @@ -pull_request_rules: - - name: delete head branch after merge - conditions: [] - actions: - delete_head_branch: {} diff --git a/README.md b/README.md index c270b1f0..dc7d1fcb 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Add the following dependency: "com.softwaremill.sttp.model" %% "core" % "1.7.10" ``` -sttp model is available for Scala 2.11, 2.12, 2.13, 3.0.0, Scala.JS and Scala Native. +sttp model is available for 2.12, 2.13, 3.0.0, Scala.JS and Scala Native. ## Project content