Skip to content

Commit badcc1b

Browse files
committed
Update actions
1 parent dca34fe commit badcc1b

File tree

5 files changed

+45
-74
lines changed

5 files changed

+45
-74
lines changed

.github/labeler.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
version: 1
22
labels:
33
- label: "automerge"
4-
authors: ["softwaremill-ci"]
4+
authors: ["github-actions[bot]"]
55
files:
66
- ".scalafmt.conf"
77
- "build.sbt"
88
- "project/build.properties"
99
- "project/plugins.sbt"
1010
- label: "dependency"
11-
authors: ["softwaremill-ci"]
11+
authors: ["github-actions[bot]"]
1212
files:
1313
- ".scalafmt.conf"
1414
- "build.sbt"

.github/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
template: |
2-
## Whats Changed
2+
## What's Changed
33
44
$CHANGES

.github/workflows/ci.yml

Lines changed: 30 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ on:
44
push:
55
branches: ['**']
66
tags: [v*]
7+
permissions:
8+
contents: write # release-drafter, auto-merge requirement
9+
pull-requests: write # labeler, auto-merge requirement
710
jobs:
811
ci-2-12:
9-
# run on 1) push, 2) external PRs, 3) softwaremill-ci PRs
12+
# run on 1) push, 2) external PRs, 3) github-actions[bot] PRs
1013
# do not run on internal, non-steward PRs since those will be run by push to branch
1114
if: |
1215
github.event_name == 'push' ||
1316
github.event.pull_request.head.repo.full_name != github.repository ||
14-
github.event.pull_request.user.login == 'softwaremill-ci'
17+
github.event.pull_request.user.login == 'github-actions[bot]'
1518
runs-on: ubuntu-24.04
1619
env:
1720
scala: 2.12
@@ -21,7 +24,7 @@ jobs:
2124
uses: actions/checkout@v2
2225

2326
- name: Set up SBT
24-
uses: sbt/setup-sbt@v1
27+
uses: sbt/setup-sbt@3e125ece5c3e5248e18da9ed8d2cce3d335ec8dd # v1, specifically v1.1.14
2528

2629
- name: Set up JDK
2730
uses: actions/setup-java@v4
@@ -48,12 +51,12 @@ jobs:
4851
run: SCALA_MAJOR_VERSION=${{ env.scala }} sbt "root/testOnly * -- -l org.elasticmq.rest.sqs.Only213"
4952

5053
ci-2-13:
51-
# run on 1) push, 2) external PRs, 3) softwaremill-ci PRs
54+
# run on 1) push, 2) external PRs, 3) github-actions[bot] PRs
5255
# do not run on internal, non-steward PRs since those will be run by push to branch
5356
if: |
5457
github.event_name == 'push' ||
5558
github.event.pull_request.head.repo.full_name != github.repository ||
56-
github.event.pull_request.user.login == 'softwaremill-ci'
59+
github.event.pull_request.user.login == 'github-actions[bot]'
5760
runs-on: ubuntu-24.04
5861
env:
5962
scala: 2.13
@@ -63,7 +66,7 @@ jobs:
6366
uses: actions/checkout@v2
6467

6568
- name: Set up SBT
66-
uses: sbt/setup-sbt@v1
69+
uses: sbt/setup-sbt@3e125ece5c3e5248e18da9ed8d2cce3d335ec8dd # v1, specifically v1.1.14
6770

6871
- name: Set up JDK
6972
uses: actions/setup-java@v4
@@ -90,12 +93,12 @@ jobs:
9093
run: SCALA_MAJOR_VERSION=${{ env.scala }} sbt root/test
9194

9295
ci-3:
93-
# run on 1) push, 2) external PRs, 3) softwaremill-ci PRs
96+
# run on 1) push, 2) external PRs, 3) github-actions[bot] PRs
9497
# do not run on internal, non-steward PRs since those will be run by push to branch
9598
if: |
9699
github.event_name == 'push' ||
97100
github.event.pull_request.head.repo.full_name != github.repository ||
98-
github.event.pull_request.user.login == 'softwaremill-ci'
101+
github.event.pull_request.user.login == 'github-actions[bot]'
99102
runs-on: ubuntu-24.04
100103
env:
101104
scala: 3
@@ -105,7 +108,7 @@ jobs:
105108
uses: actions/checkout@v2
106109

107110
- name: Set up SBT
108-
uses: sbt/setup-sbt@v1
111+
uses: sbt/setup-sbt@3e125ece5c3e5248e18da9ed8d2cce3d335ec8dd # v1, specifically v1.1.14
109112

110113
- name: Set up JDK
111114
uses: actions/setup-java@v4
@@ -132,12 +135,12 @@ jobs:
132135
run: SCALA_MAJOR_VERSION=${{ env.scala }} sbt root/test
133136

134137
ci-native-image-agent-config-verification:
135-
# run on 1) push, 2) external PRs, 3) softwaremill-ci PRs
138+
# run on 1) push, 2) external PRs, 3) github-actions[bot] PRs
136139
# do not run on internal, non-steward PRs since those will be run by push to branch
137140
if: |
138141
github.event_name == 'push' ||
139142
github.event.pull_request.head.repo.full_name != github.repository ||
140-
github.event.pull_request.user.login == 'softwaremill-ci'
143+
github.event.pull_request.user.login == 'github-actions[bot]'
141144
runs-on: ubuntu-24.04
142145
env:
143146
scala: 2.13
@@ -147,7 +150,7 @@ jobs:
147150
uses: actions/checkout@v2
148151

149152
- name: Set up SBT
150-
uses: sbt/setup-sbt@v1
153+
uses: sbt/setup-sbt@3e125ece5c3e5248e18da9ed8d2cce3d335ec8dd # v1, specifically v1.1.14
151154

152155
- name: Set up JDK
153156
uses: actions/setup-java@v4
@@ -201,12 +204,12 @@ jobs:
201204
fi
202205
203206
ci-docker:
204-
# run on 1) push, 2) external PRs, 3) softwaremill-ci PRs
207+
# run on 1) push, 2) external PRs, 3) github-actions[bot] PRs
205208
# do not run on internal, non-steward PRs since those will be run by push to branch
206209
if: |
207210
github.event_name == 'push' ||
208211
github.event.pull_request.head.repo.full_name != github.repository ||
209-
github.event.pull_request.user.login == 'softwaremill-ci'
212+
github.event.pull_request.user.login == 'github-actions[bot]'
210213
runs-on: ubuntu-24.04
211214
env:
212215
scala: 2.13
@@ -216,7 +219,7 @@ jobs:
216219
uses: actions/checkout@v2
217220

218221
- name: Set up SBT
219-
uses: sbt/setup-sbt@v1
222+
uses: sbt/setup-sbt@3e125ece5c3e5248e18da9ed8d2cce3d335ec8dd # v1, specifically v1.1.14
220223

221224
- name: Set up JDK
222225
uses: actions/setup-java@v4
@@ -256,7 +259,7 @@ jobs:
256259
uses: actions/checkout@v2
257260

258261
- name: Set up SBT
259-
uses: sbt/setup-sbt@v1
262+
uses: sbt/setup-sbt@3e125ece5c3e5248e18da9ed8d2cce3d335ec8dd # v1, specifically v1.1.14
260263

261264
- name: Set up JDK
262265
uses: actions/setup-java@v4
@@ -300,7 +303,7 @@ jobs:
300303

301304
- name: Publish release notes
302305
id: create_release
303-
uses: release-drafter/release-drafter@v5
306+
uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6, specifically v6.1.0
304307
with:
305308
config-name: release-drafter.yml
306309
publish: true
@@ -329,7 +332,7 @@ jobs:
329332
uses: actions/checkout@v2
330333

331334
- name: Set up SBT
332-
uses: sbt/setup-sbt@v1
335+
uses: sbt/setup-sbt@3e125ece5c3e5248e18da9ed8d2cce3d335ec8dd # v1, specifically v1.1.14
333336

334337
- name: Set up JDK
335338
uses: actions/setup-java@v4
@@ -351,7 +354,7 @@ jobs:
351354
key: ${{ runner.os }}-sbt-release-${{ hashFiles('**/build.sbt') }}
352355

353356
- name: Login to DockerHub
354-
uses: docker/login-action@v1
357+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3, specifically v3.6.0
355358
with:
356359
username: ${{ secrets.DOCKERHUB_USERNAME }}
357360
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -362,40 +365,15 @@ jobs:
362365
- name: Publish JVM native docker image
363366
run: sbt "project nativeServer; assembly; Docker / publish"
364367

365-
# `automerge` label is attached iff there is exactly one file changed by steward and this file belongs to a
366-
# whitelist specified by `labeler.yml`
367368
label:
368-
name: Attach automerge label
369-
# only for PRs by softwaremill-ci
370-
if: github.event.pull_request.user.login == 'softwaremill-ci'
371-
runs-on: ubuntu-24.04
372-
steps:
373-
- uses: actions/checkout@v3
374-
with:
375-
fetch-depth: 2
376-
# count number of files changed
377-
- name: Count number of files changed
378-
id: count-changed-files
379-
run: |
380-
N=$(git diff --name-only -r HEAD^1 HEAD | wc -w)
381-
echo "changed_files_num=$N" >> $GITHUB_OUTPUT
382-
- name: Launch labeler
383-
# skip if more than one file changed
384-
if: steps.count-changed-files.outputs.changed_files_num == 1
385-
uses: srvaroa/labeler@master
386-
env:
387-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
369+
# only for PRs by github-actions[bot]
370+
if: github.event.pull_request.user.login == 'github-actions[bot]'
371+
uses: softwaremill/github-actions-workflows/.github/workflows/label.yml@main
372+
secrets: inherit
388373

389374
auto-merge:
390-
name: Auto merge
391-
# only for PRs by softwaremill-ci
392-
if: github.event.pull_request.user.login == 'softwaremill-ci'
375+
# only for PRs by github-actions[bot]
376+
if: github.event.pull_request.user.login == 'github-actions[bot]'
393377
needs: [ci-2-12, ci-2-13, ci-3, ci-docker, ci-native-image-agent-config-verification, label]
394-
runs-on: ubuntu-24.04
395-
steps:
396-
- id: automerge
397-
name: automerge
398-
uses: "pascalgn/automerge-action@v0.15.6"
399-
env:
400-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
401-
MERGE_METHOD: "squash"
378+
uses: softwaremill/github-actions-workflows/.github/workflows/auto-merge.yml@main
379+
secrets: inherit

.github/workflows/scala-steward.yml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,14 @@ on:
66
- cron: '0 0 * * *'
77
workflow_dispatch:
88

9+
permissions:
10+
contents: write # Required to checkout and push changes
11+
pull-requests: write # Required to create PRs for dependency updates
12+
913
jobs:
1014
scala-steward:
11-
runs-on: ubuntu-24.04
12-
steps:
13-
- name: Checkout
14-
uses: actions/checkout@v3
15-
- name: Set up JDK 11
16-
uses: actions/setup-java@v4
17-
with:
18-
distribution: 'temurin'
19-
java-version: '11'
20-
cache: 'sbt'
21-
- name: Launch Scala Steward
22-
uses: scala-steward-org/scala-steward-action@v2
23-
with:
24-
author-name: scala-steward
25-
author-email: scala-steward
26-
github-token: ${{ secrets.REPO_GITHUB_TOKEN }}
27-
repo-config: .scala-steward.conf
28-
ignore-opts-files: false
15+
uses: softwaremill/github-actions-workflows/.github/workflows/scala-steward.yml@main
16+
secrets:
17+
github-token: ${{ secrets.GITHUB_TOKEN }}
18+
with:
19+
java-version: '21'

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ project/boot
1414
.env
1515

1616
.metals
17-
.bloop
17+
.bloop
18+
.vscode
19+
.cursor

0 commit comments

Comments
 (0)