Upgrade to latest versions #319
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |