-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (57 loc) · 2.42 KB
/
changelog.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
64
65
66
67
68
69
70
71
---
name: Generate CHANGELOG.md
on:
workflow_dispatch:
schedule:
- cron: "0 0 1 */1 *" # Runs on the first of every month
jobs:
update_changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Pull latest Alpine and get SHA256
run: |
docker pull alpine:latest
ALPINE_SHA=$(docker image inspect alpine:latest --format '{{index .RepoDigests 0}}' | cut -d'@' -f2)
echo "ALPINE_SHA=$ALPINE_SHA" >> $GITHUB_ENV
- name: Check versions of openssh-server, gnupg, and curl
run: |
docker run --rm alpine:latest sh -c '
apk update &&
apk add --no-cache openssh-server gnupg curl &&
apk info -w openssh-server gnupg curl' | tail -n6 > versions.txt
cat versions.txt
OPENSSH_VER=$(grep -o 'openssh-server-.*' versions.txt | awk '{print $1}')
GNUPG_VER=$(grep -o 'gnupg-.*' versions.txt | awk '{print $1}')
CURL_VER=$(grep -o 'curl-.*' versions.txt | awk '{print $1}')
echo $OPENSSH_VER
echo $GNUPG_VER
echo $CURL_VER
echo "OPENSSH_VER=$OPENSSH_VER" >> "$GITHUB_ENV"
echo "GNUPG_VER=$GNUPG_VER" >> "$GITHUB_ENV"
echo "CURL_VER=$CURL_VER" >> "$GITHUB_ENV"
- name: Update CHANGELOG.md
run: |
DATE=$(date '+%Y-%m')
echo "## $DATE" >> CHANGELOG.md
echo "----------------" >> CHANGELOG.md
echo "- Alpine SHA256: $ALPINE_SHA" >> CHANGELOG.md
echo "- openssh-server version: $OPENSSH_VER" >> CHANGELOG.md
echo "- gnupg version: $GNUPG_VER" >> CHANGELOG.md
echo "- curl version: $CURL_VER" >> CHANGELOG.md
cat CHANGELOG.md
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
branch: "feature/update-alpine-$(date '+%Y-%m')"
commit-message: "Generate CHANGELOG.md for $(date '+%Y-%m')"
title: "Generate CHANGELOG.md for $(date '+%Y-%m')"
body: |
Base image updated to Alpine SHA256: ${{ env.ALPINE_SHA }}
- openssh-server version: ${{ env.OPENSSH_VER }}
- gnupg version: ${{ env.GNUPG_VER }}
- curl version: ${{ env.CURL_VER }}
Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
labels: "automated update"