-
Notifications
You must be signed in to change notification settings - Fork 113
63 lines (58 loc) · 2.72 KB
/
check-latest-images.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
58
59
60
61
62
63
name: Update images in sample build strategies
on:
schedule:
- cron: '0 0 * * *'
issue_comment:
types: [created, edited]
jobs:
check-new-versions:
if: contains(github.event.comment.body, '/rebase') || github.event_name == 'schedule'
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: gcr.io/kaniko-project/executor
latest-release-url: https://api.github.com/repos/GoogleContainerTools/kaniko/releases/latest
- image: quay.io/containers/buildah
latest-release-url: https://quay.io/api/v1/repository/containers/buildah/tag/
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check and modify ${{ matrix.image }}
env:
IMAGE: ${{ matrix.image }}
LATEST_RELEASE_URL: ${{ matrix.latest-release-url }}
run: |
for directory in docs pkg samples test; do hack/check-latest-images.sh ${IMAGE} ${LATEST_RELEASE_URL} ${directory}; done
- name: Check image change
run: |
echo "FROM=$(git diff --unified=0 | grep '^[-].*image: .*/.*/.*:' | head --lines=1 | cut --delimiter=':' --fields='3' | sed 's/[^[[:digit:].]//g')" >> $GITHUB_OUTPUT
echo "TO=$(git diff --unified=0 | grep '^[+].*image: .*/.*/.*:' | head --lines=1 | cut --delimiter=':' --fields='3' | sed 's/[^[[:digit:].]//g')" >> $GITHUB_OUTPUT
id: image-diff
- name: Create pull request
uses: peter-evans/create-pull-request@v7
with:
# Branch details:
branch: ${{ matrix.image }}
delete-branch: true
# Commit details
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
commit-message: Bump ${{ matrix.image }} from ${{ steps.image-diff.outputs.FROM }} to ${{ steps.image-diff.outputs.TO }}
sign-commits: true
signoff: true
# PR details
title: Bump ${{ matrix.image }} from ${{ steps.image-diff.outputs.FROM }} to ${{ steps.image-diff.outputs.TO }}
body: |
# Changes
Bumps ${{ matrix.image }} from ${{ steps.image-diff.outputs.FROM }} to ${{ steps.image-diff.outputs.TO }}.
You can trigger a rebase manually by commenting `/rebase` and resolve any conflicts with this PR.
# Submitter Checklist
- [ ] Includes tests if functionality changed/was added
- [ ] Includes docs if changes are user-facing
- [x] [Set a kind label on this PR](https://prow.k8s.io/command-help#kind)
- [x] Release notes block has been filled in, or marked NONE
# Release Notes
```release-note
NONE
```
labels: kind/dependency-change