-
Notifications
You must be signed in to change notification settings - Fork 81
63 lines (54 loc) · 3.19 KB
/
check-alpine-version.yml
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: Check Supported Alpine Version
on:
schedule:
- cron: "0 17 * * *"
workflow_dispatch:
jobs:
create-prs:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: v8
- name: Get current Alpine version
id: alpine-current
run: |
version=$(sed -n 's/^FROM alpine:\(.*\)/\1/p' Dockerfile.goreleaser)
echo "version=$version" >> $GITHUB_OUTPUT
- name: Get latest Alpine tag semantic version, not 'latest'
id: alpine-latest
run: |
version=$(curl -s https://hub.docker.com/v2/repositories/library/alpine/tags/?page_size=100 | jq -r '.results[].name' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n 1)
echo "version=$version" >> $GITHUB_OUTPUT
- name: Update from ${{ steps.alpine-current.outputs.version }} to alpine:${{ steps.alpine-latest.outputs.version }}
id: update-alpine
if: steps.alpine-current.outputs.version != steps.alpine-latest.outputs.version
run: ./scripts/update-alpine-version.sh ${{ steps.alpine-latest.outputs.version }}
- name: Create pull request
if: steps.update-alpine.outcome == 'success'
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: |
Dockerfile
Dockerfile.goreleaser
branch: "launchdarklyreleasebot/update-to-alpine${{ steps.alpine-latest.outputs.version }}-${{ matrix.branch }}"
author: "LaunchDarklyReleaseBot <[email protected]>"
committer: "LaunchDarklyReleaseBot <[email protected]>"
labels: ${{ matrix.branch }}
title: "fix(deps): update Dockerfiles from ${{ steps.alpine-current.outputs.version }} to alpine:${{ steps.alpine-latest.outputs.version }}"
commit-message: "Bumps from ${{ steps.alpine-current.outputs.version }} -> alpine:${{ steps.alpine-latest.outputs.version }}"
body: |
It's time to update Relay's Docker image Alpine versions. Alpine updates should generally be consumed
as soon as possible since they contain patches for CVEs.
| | Current repo configuration | Desired repo configuration |
|-------------|------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| Alpine Version | ${{ steps.alpine-current.outputs.version }} | [alpine:${{ steps.alpine-latest.outputs.version }}](https://hub.docker.com/_/alpine/tags) |
This PR's change was generated by running:
```bash
./scripts/update-alpine-version.sh ${{ steps.alpine-latest.outputs.version }}
```
- [ ] I have triggered CI on this PR (either close & reopen this PR in Github UI, or `git commit -m "run ci" --allow-empty && git push`)