-
Notifications
You must be signed in to change notification settings - Fork 5
37 lines (36 loc) · 1.34 KB
/
update-default.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
on:
push:
branches:
- main
jobs:
update_default:
runs-on: ubuntu-latest
timeout-minutes: 3
permissions:
contents: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- id: update_default
run: |
SBT_VERSION=$(grep '^sbt\.version' "project/build.properties" | tr '=\r' ' ' | awk '{ print $2; }')
yq e -i ".inputs.sbt-runner-version.default = \"${SBT_VERSION}\"" action.yml
git add action.yml
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github actions"
if git commit -m "update default sbt version to ${SBT_VERSION}"; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "sbt_version=${SBT_VERSION}" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Pull Request
if: steps.update_default.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v4
with:
title: "deps: Update sbt to ${{ steps.update_default.outputs.sbt_version }}"
branch: "update-default-sbt-${{ steps.update_default.outputs.sbt_version }}"
base: ${{ github.head_ref }}