-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf17dc6
commit 2d92d87
Showing
1 changed file
with
61 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,63 @@ | ||
--- | ||
name: Update mise tool versions | ||
|
||
"on": | ||
schedule: | ||
- cron: 0 15 1 * * # First of the month @ 3pm UTC | ||
workflow_dispatch: {} | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
updatecli_major: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# required to write to the repo | ||
contents: write | ||
# required to open a pr with changes | ||
pull-requests: write | ||
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 | ||
|
||
- 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 | ||
- name: configure git | ||
if: env.CHANGES == 'true' | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: determine branch name | ||
if: env.CHANGES == 'true' | ||
run: | | ||
echo "BRANCH_NAME=mise-updates-$(date +'%Y-%m-%d')" >> $GITHUB_ENV | ||
- name: commit and push changes | ||
if: env.CHANGES == 'true' | ||
run: | | ||
git checkout -b $BRANCH_NAME | ||
git add .mise.toml | ||
git commit -m 'Update mise tool versions' | ||
git push --set-upstream origin $BRANCH_NAME | ||
- name: create pull request | ||
if: env.CHANGES == 'true' | ||
run: | | ||
gh pr create \ | ||
--base main \ | ||
--title "Update mise tool versions" \ | ||
--label automated-dependency-updates | ||
env: | ||
# Required for the `gh` CLI | ||
GH_TOKEN: ${{ github.token }} | ||
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 | ||
|
||
- 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 | ||
- name: configure git | ||
if: env.CHANGES == 'true' | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: determine branch name | ||
if: env.CHANGES == 'true' | ||
run: | | ||
echo "BRANCH_NAME=mise-updates-$(date +'%Y-%m-%d')" >> $GITHUB_ENV | ||
- name: commit and push changes | ||
if: env.CHANGES == 'true' | ||
run: | | ||
git checkout -b $BRANCH_NAME | ||
git add .mise.toml | ||
git commit -m 'Update mise tool versions' | ||
git push --set-upstream origin $BRANCH_NAME | ||
- name: create pull request | ||
if: env.CHANGES == 'true' | ||
run: | | ||
gh pr create \ | ||
--base main \ | ||
--title "Update mise tool versions" \ | ||
--label automated-dependency-updates | ||
env: | ||
# Required for the `gh` CLI | ||
GH_TOKEN: ${{ github.token }} |