forked from osmosis-labs/osmosis
-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (52 loc) · 1.65 KB
/
go-mod-auto-bump.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# This workflow is manually triggered to update go.mod of:
# * osmoutils
# * osmomath
# * x/ibc-hooks
# * x/epochs
# It is triggerred by a manual workflow:
# https://github.com/osmosis-labs/osmosis/actions/workflows/go-mod-auto-bump.yml
name: Go Mod Auto Version Update
on:
workflow_dispatch:
inputs:
target-branch:
description: "Target Branch"
default: ""
required: true
permissions:
contents: write
jobs:
update_go_mod:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set GH config
run: |
git config user.email "[email protected]"
git config user.name "github-actions"
# Setup Go
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ">=1.22.0"
- name: Fetch branches and checkout target
run: |
git fetch origin ${{ inputs.target-branch }}
git checkout ${{ inputs.target-branch }}
- name: Run script
run: |
LATEST_TARGET_COMMIT=$(git rev-parse ${{ inputs.target-branch }})
bash ./scripts/update-go-mod.sh $LATEST_TARGET_COMMIT
- name: Add Changes
id: add_changes
run: |
git add .
echo ANY_CHANGES_ADDED=$(git diff --name-only --cached) >> $GITHUB_OUTPUT
- name: Commit and Push Changes
if: ${{ steps.add_changes.outputs.ANY_CHANGES_ADDED != '' }}
run: |
git commit -m "Auto: update go.mod after push to ${{ inputs.target-branch }} that modified dependencies locally"
git push origin ${{ inputs.target-branch }}