add update go-version to workflows

This commit is contained in:
Lifailon
2026-10-28 13:31:14 +03:00
parent d3f4fb791e
commit 2140f90dc9
2 changed files with 12 additions and 3 deletions
+1 -1
View File
@@ -393,7 +393,7 @@ jobs:
run: |
echo "# 👮‍♂️ Linters check" >> $GITHUB_STEP_SUMMARY
echo "## Golangci lint" >> $GITHUB_STEP_SUMMARY
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.15.0
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
golangci-lint run -v ./... 2>&1 | tee -a $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
+11 -2
View File
@@ -11,6 +11,10 @@ on:
description: 'Update dependencies in modules'
default: false
type: boolean
Workflows:
description: 'Update go version in workflows'
default: false
type: boolean
PR:
description: 'Create Pull Request'
default: false
@@ -44,7 +48,6 @@ jobs:
go build -v -o /dev/null ./...
- name: Update Go version
if: ${{ github.event.inputs.Version != '' }}
run: |
go mod edit -go=${{ github.event.inputs.Version }}
# go mod edit -toolchain=go${{ github.event.inputs.Version }}
@@ -64,6 +67,11 @@ jobs:
go vet ./...
go build -v -o /dev/null ./...
- name: Update Go version in workflows
if: ${{ github.event.inputs.Workflows == 'true' }}
run: |
sed -i -E "s/go-version:\s*[0-9.]+/go-version: ${{ github.event.inputs.Version }}/" .github/workflows/*.yml
- name: Create Pull Request for update go version and modules
if: ${{ github.event.inputs.Modules == 'true' && github.event.inputs.PR == 'true' }}
uses: peter-evans/create-pull-request@v8
@@ -75,4 +83,5 @@ jobs:
body: "Updated Go version to **${{ github.event.inputs.Version }}** as well as the module dependencies in `go.mod` and `go.sum`."
add-paths: |
go.mod
go.sum
go.sum
.github/workflows/*.yml