Skip to content

Commit

Permalink
Merge pull request #14 from Joly0/main
Browse files Browse the repository at this point in the history
Create update-unbound.yml
  • Loading branch information
devzwf authored May 19, 2024
2 parents 0997e68 + d0aaa90 commit cbb2b00
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 3 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/update-unbound.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Update Unbound Dockerfile

on:
schedule:
- cron: '0 0 * * *' # Run every day at midnight
workflow_dispatch: # Allows manual triggering

jobs:
update:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Get latest Unbound version
id: get_version
run: |
URL="https://nlnetlabs.nl/downloads/unbound/"
VERSION=$(curl -sL $URL | grep -oP 'unbound-\K[\d.]+(?=.tar.gz)' 2>/dev/null | tail -1)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Get SHA256 hash
id: get_sha256
run: |
URL="https://nlnetlabs.nl/downloads/unbound/"
SHA256=$(curl -sL $URL | grep -oP 'unbound-\d+(\.\d+)+\.tar\.gz\.sha256' | tail -1)
SHA256_HASH=$(curl -sL "$URL/$SHA256" | awk '{print $1}')
echo "SHA256_HASH=${SHA256_HASH}" >> $GITHUB_ENV
- name: Check if Dockerfile needs update
id: check_dockerfile
run: |
CURRENT_VERSION=$(grep -oP 'ARG UNBOUND_VERSION=\K[\d.]+' Dockerfile)
if [ "$CURRENT_VERSION" != "${{ env.VERSION }}" ]; then
echo "Dockerfile needs update"
echo "UPDATE_DOCKERFILE=true" >> $GITHUB_ENV
else
echo "Dockerfile is up to date"
echo "UPDATE_DOCKERFILE=false" >> $GITHUB_ENV
fi
- name: Create Pull Request
if: steps.check_dockerfile.outputs.UPDATE_DOCKERFILE == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update-unbound-version
commit-message: "chore: Update Unbound version to ${{ env.VERSION }}"
title: "chore: Update Unbound version to ${{ env.VERSION }}"
body: "This pull request updates the Unbound version in the Dockerfile to ${{ env.VERSION }}."
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ ARG TAG='latest'

FROM debian:bullseye as unbound

ARG UNBOUND_VERSION=1.19.3
ARG UNBOUND_SHA256=3ae322be7dc2f831603e4b0391435533ad5861c2322e34a76006a9fb65eb56b9
ARG UNBOUND_DOWNLOAD_URL=https://nlnetlabs.nl/downloads/unbound/unbound-1.19.3.tar.gz
ARG UNBOUND_VERSION=1.20.0
ARG UNBOUND_SHA256=56b4ceed33639522000fd96775576ddf8782bb3617610715d7f1e777c5ec1dbf
ARG UNBOUND_DOWNLOAD_URL=https://nlnetlabs.nl/downloads/unbound/unbound-1.20.0.tar.gz

WORKDIR /tmp/src

Expand Down

0 comments on commit cbb2b00

Please sign in to comment.