Skip to content

Commit

Permalink
Add scala steward
Browse files Browse the repository at this point in the history
  • Loading branch information
adamw committed Feb 22, 2024
1 parent 5c25de1 commit 0a2c78a
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 1
labels:
- label: "automerge"
authors: ["softwaremill-ci"]
files:
- "build.sbt"
- "project/Versions.scala"
- "project/plugins.sbt"
- label: "dependency"
authors: ["softwaremill-ci"]
files:
- "build.sbt"
- "project/Versions.scala"
- "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 @@ -71,3 +71,41 @@ jobs:
version: "v${{ env.VERSION }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# `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@v3
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.15.6"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_METHOD: "squash"
28 changes: 28 additions & 0 deletions .github/workflows/scala-steward.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Scala Steward

# This workflow will launch at 00:00 every day
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
scala-steward:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
cache: 'sbt'
- name: Launch Scala Steward
uses: scala-steward-org/scala-steward-action@v2
with:
author-name: scala-steward
author-email: scala-steward
github-token: ${{ secrets.REPO_GITHUB_TOKEN }}
repo-config: .scala-steward.conf
ignore-opts-files: false
Empty file added .scala-steward.conf
Empty file.

0 comments on commit 0a2c78a

Please sign in to comment.