-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
71 lines (62 loc) · 1.9 KB
/
action.yaml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
name: Update mise tool versions
author: PrefectHQ
description: This action will upgrade tools managed by mise and open a PR.
inputs: {}
runs:
using: composite
steps:
- name: checkout
uses: actions/checkout@v4
with:
# This should be 'main' anyway as it will run
# on a schedule, but let's be explicit so we can,
# for example, run this from pull request branches.
ref: 'main'
- name: install mise
uses: jdx/mise-action@v2
- name: upgrade tools in mise
run: mise upgrade --bump
shell: bash
- name: determine if there are changes
run: |
if [[ $(git diff --name-only | wc -l) -eq 0 ]]; then
echo "No changes detected, exiting"
echo "CHANGES=false" >> $GITHUB_ENV
exit 0
else
echo "CHANGES=true" >> $GITHUB_ENV
fi
shell: bash
- name: configure git
if: env.CHANGES == 'true'
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
shell: bash
- name: determine branch name
if: env.CHANGES == 'true'
run: |
echo "BRANCH_NAME=mise-updates-$(date +'%Y-%m-%d')" >> $GITHUB_ENV
shell: bash
- name: commit and push changes
if: env.CHANGES == 'true'
run: |
git checkout -b $BRANCH_NAME
git diff .mise.toml
git add .mise.toml
git commit -m 'Update mise tool versions'
git push --set-upstream origin $BRANCH_NAME
shell: bash
- name: create pull request
if: env.CHANGES == 'true'
run: |
gh pr create \
--base main \
--title "Update mise tool versions" \
--body "Updates the tool versions managed by mise." \
--label automated-dependency-updates
env:
# Required for the `gh` CLI
GH_TOKEN: ${{ github.token }}
shell: bash