Skip to content

Run Scala Steward on the managed repositories #17

Run Scala Steward on the managed repositories

Run Scala Steward on the managed repositories #17

Workflow file for this run

name: Run Scala Steward on the managed repositories
on:
workflow_dispatch:
inputs:
repository:
description: "Repository to update. Leave empty to update every repository managed by the GitHub App."
required: false
default: ""
extra-options:
description: |
Extra options to append to base `.scala-steward.conf`. For example, to instruct Scala Steward to just
update SBT you can set this to: `updates.allow = [{ groupId = "org.scala-sbt", artifactId = "sbt" }]`
to just update SBT.
required: false
default: ""
schedule:
- cron: "0 5 1,15 * *"
jobs:
get-repositories:
name: Select repositories to update
runs-on: ubuntu-latest
outputs:
repositories: ${{ steps.repositories.outputs.repositories }}
steps:
- name: Generate token
id: github_app
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{ secrets.APP_ID }}
installation_retrieval_mode: id
installation_retrieval_payload: ${{ secrets.APP_INSTALLATION_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Select repositories to update
id: repositories
run: |
if [ "${{ github.event.inputs.repository }}" != "" ]; then
echo "repositories=[\"permutive-engineering/${{ github.event.inputs.repository }}\"]" >> $GITHUB_OUTPUT
else
echo "repositories=$(gh api installation/repositories -q '.repositories | map(.full_name)')" >> $GITHUB_OUTPUT
fi
env:
GITHUB_TOKEN: ${{ steps.github_app.outputs.token }}
run-scala-steward:
name: ${{ matrix.repo }} - Dependency update
runs-on: ubuntu-latest
needs: get-repositories
strategy:
fail-fast: false
matrix:
repo: ${{ fromJson(needs.get-repositories.outputs.repositories) }}
steps:
- name: Checkout project
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Append extra options
run: echo "${{ github.event.inputs.extra-options }}" >> .github/.scala-steward.conf
- name: Launch Scala Steward on ${{ matrix.repo }}
uses: scala-steward-org/scala-steward-action@b92edd82d11e0ed7eb5238eb867073fa6a8aaaf2 # v2.65.0
with:
github-repository: ${{ matrix.repo }}
github-app-auth-only: "true"
github-app-id: ${{ secrets.APP_ID }}
github-app-installation-id: ${{ secrets.APP_INSTALLATION_ID }}
github-app-key: ${{ secrets.APP_PRIVATE_KEY }}