1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-30 05:59:39 +02:00
sap-jenkins-library/.github/workflows/update-go-dependencies.yml
Valentin dfd947b7e1
Update go version to 1.23 and removed some helper methods in favor of STD library (#5200)
* update go version

* fix go vet errors

* replaces stringutils with slices std package

* added slices package

* 1.22.4 to 1.23.4

---------

Co-authored-by: Valentin <valentin.uchkunev@sap.com>
2024-12-12 17:32:12 +02:00

32 lines
1.3 KiB
YAML

name: Update go dependencies and create PR
on:
# Allow to trigger this manually just in case updates are required outside of the schedule. See https://goobar.io/2019/12/07/manually-trigger-a-github-actions-workflow/ for info on how that works.
repository_dispatch:
types: update-dependencies
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: styfle/cancel-workflow-action@0.11.0
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.23.4'
- name: Perform update
run: |
git checkout -B gh-action-update-golang-dependencies
go get -u
go mod tidy
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -am "Automated go dependency update"
git push origin gh-action-update-golang-dependencies -f
- name: Create Pull Request
uses: SAP/project-piper-action@master
with:
piper-version: master
command: githubCreatePullRequest
flags: --body="Automated update for Go dependencies by running `go get -u` and `go mod tidy`" --head=gh-action-update-golang-dependencies --title="Update Go dependencies" --token ${{ secrets.GO_DEPENDENCY_UPDATE_TOKEN }}