-
Notifications
You must be signed in to change notification settings - Fork 5
57 lines (53 loc) · 2.08 KB
/
dep-update.yaml
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
name: Upgrade to latest versions
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 1" # Every monday 00:00
jobs:
versions:
runs-on: ubuntu-latest
strategy:
matrix:
branch:
- "main"
steps:
- uses: actions/checkout@v2
with:
ref: ${{ matrix.branch }}
- uses: actions/setup-go@v2
with:
go-version: 1.19
- name: Update jsonnet dependencies
run: |
make update
# Reset jsonnetfile.lock.json if no dependencies were updated
changedFiles=$(git diff --name-only | grep -v 'jsonnetfile.lock.json')
if [[ $changedFiles == "" ]]; then
echo "There was nothing to update, the job will intentionally fail to avoid only commiting a lock file"
git checkout -- jsonnetfile.lock.json;
fi
make generate
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
id: cpr
with:
commit-message: "[bot] [${{ matrix.branch }}] Automated dependencies update"
title: "[bot] [${{ matrix.branch }}] Automated dependencies update"
body: |
Looks like some of our dependencies got updated upstream!
This is an automated PR updating those dependencies.
Configuration of the workflow is located in `.github/workflows/dep-update.yaml`
delete-branch: true
author: "Roboquat <[email protected]>"
committer: "Roboquat <[email protected]>"
reviewers: "gitpod-io/platform"
branch: "roboquat/automated-dependency-update-${{ matrix.branch }}"
base: "${{ matrix.branch }}"
# GITHUB_TOKEN cannot be used as it won't trigger CI in a created PR
# More in https://github.com/peter-evans/create-pull-request/issues/155
token: ${{ secrets.ROBOQUAT_PAT }}
- name: Enable auto-merge
uses: peter-evans/enable-pull-request-automerge@v1
with:
token: ${{ secrets.ROBOQUAT_PAT }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}