1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
sap-jenkins-library/.github/workflows/update-go-dependencies.yaml
Florian Wilhelm e77209922a
Run automated go dependency update once a month (#1464)
* Assign users to automated go dependency update

* update once a month
2020-04-29 16:28:57 +02:00

33 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
# Schedule once a month
schedule:
- cron: '0 10 3 * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: '1.13.x'
- 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:
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 }}