Skip to content

Commit

Permalink
ci(go-update): Edit go.mod directly instead of using go mod tidy (#…
Browse files Browse the repository at this point in the history
…51)

<!-- markdownlint-disable MD041 -->

**Issue:** close #

- [ ] This Pull Request introduces a new feature.
- [ ] This Pull Request fixes a bug.

It requires the latest Go to be installed.

<!--
A clear and concise description
  - Why did you make this change?
  - Please describe how this method is better than others.
-->

<br />

- [x] I agree to follow the [Code of
Conduct](https://github.com/5ouma/mli/blob/main/.github/CODE_OF_CONDUCT.md).
  • Loading branch information
5ouma committed Mar 9, 2024
1 parent 3ec6e97 commit 197e973
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/go-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:
pull-requests: write

jobs:
Gum:
Go-Update:
runs-on: Ubuntu-Latest

steps:
Expand All @@ -23,10 +23,16 @@ jobs:
version="$(curl "https://go.dev/VERSION?m=text" | head -n 1)"
echo "version=${version#go}" | tee -a "$GITHUB_OUTPUT"
- name: ⬆️ Update Go version
run: go mod tidy -go="${{ steps.go.outputs.version }}"
- name: 📋 Find and Replace the Gum Version
id: find-replace
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "go [0-9]+.[0-9]+.[0-9]+"
replace: "go ${{ steps.go.outputs.version }}"
include: "go.mod"

- name: 🎈 Create Pull Request
if: ${{ steps.find-replace.outputs.modifiedFiles > 0 }}
uses: peter-evans/create-pull-request@v6
with:
commit-message: |
Expand All @@ -38,4 +44,5 @@ jobs:
title: |
chore(deps): Bump Go version to ${{ steps.go.outputs.version }}
body: Bumps Go version to ${{ steps.go.outputs.version }}
labels: dependencies
labels: |
Type: Dependencies

0 comments on commit 197e973

Please sign in to comment.