Generate CHANGELOG.md #10
Workflow file for this run
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: 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 -n9 > 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=$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 "docker.io/alpine@$ALPINE_SHA" >> CHANGELOG.md | |
echo "- $OPENSSH_VER" >> CHANGELOG.md | |
echo "- $GNUPG_VER" >> CHANGELOG.md | |
echo "- $CURL_VER" >> CHANGELOG.md | |
cat CHANGELOG.md | |
rm versions.txt | |
echo "DATE=$DATE" >> $GITHUB_ENV | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
branch: "changelog-update" | |
commit-message: Generate CHANGELOG.md for ${{ env.DATE }} | |
title: Generate CHANGELOG.md for ${{ env.DATE }} | |
body: | | |
docker.io/alpine@${{ env.ALPINE_SHA }} | |
- ${{ env.OPENSSH_VER }} | |
- ${{ env.GNUPG_VER }} | |
- ${{ env.CURL_VER }} | |
Auto-generated by [create-pull-request][1] | |
[1]: https://github.com/peter-evans/create-pull-request |