Skip to content

update-caddy-modules #81

update-caddy-modules

update-caddy-modules #81

name: update-caddy-modules
on:
schedule:
- cron: '40 4 * * *'
permissions:
pull-requests: write
contents: write
jobs:
update-caddy-modules:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Latest caddy-dns/porkbun Release
id: dns-porkbun
run: |
release_tag=$(curl -sL https://api.github.com/repos/caddy-dns/porkbun/releases/latest | jq -r ".tag_name")
echo "release_tag=$release_tag" >> $GITHUB_OUTPUT
current_tag=$(grep "\-\-with github.com" Dockerfile | cut -d'@' -f 2)
echo "current_tag=$current_tag" >> $GITHUB_OUTPUT
- name: Replace string in file
if: steps.dns-porkbun.outputs.current_tag != steps.dns-porkbun.outputs.release_tag
uses: MathieuSoysal/[email protected]
with:
file: Dockerfile
old-string: ${{ steps.dns-porkbun.outputs.current_tag }}
new-string: ${{ steps.dns-porkbun.outputs.release_tag }}
- name: Get current date
id: date
run: echo "now=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: Updateto ${{ steps.dns-porkbun.outputs.release_tag }}
title: Bump module /caddy-dns/porkbun from ${{ steps.dns-porkbun.outputs.current_tag }} to ${{ steps.dns-porkbun.outputs.release_tag }}
body: |
Updates [github.com/caddy-dns/porkbun/][1] to ${{ steps.dns-porkbun.outputs.release_tag }}
Auto-generated by [create-pull-request][2]
[1]: https://github.com/caddy-dns/porkbun
[2]: https://github.com/peter-evans/create-pull-request
labels: dependencies
branch: "modules-update-${{ env.now }}"