Update coredns image tags automatically #221
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: Create PRs for new CoreDNS versions | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 10 * * *" | |
pull_request: | |
branches: | |
- main | |
jobs: | |
generator: | |
name: Generate Step for new CoreDNS versions | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout rock repository | |
uses: actions/checkout@v4 | |
with: | |
path: coredns-rock | |
ref: ${{ github.head_ref || 'main' }} | |
- name: Checkout coredns repository | |
uses: actions/checkout@v4 | |
with: | |
repository: coredns/coredns | |
path: coredns | |
fetch-tags: true | |
fetch-depth: 0 | |
- name: Craft using Make target | |
id: emit-rockcraft | |
run: | | |
pushd coredns-rock | |
make COREDNS_GIT_DIR=../coredns update-component | |
popd | |
- name: Commit and push new rockcraft.yaml | |
id: commit-rockcraft | |
if: ${{ steps.emit-rockcraft.outputs.tags != '[]' }} | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
commit-message: Update CoreDNS versions with ${{ join(fromJSON(steps.emit-rockcraft.outputs.tags), ', ') }} | |
title: "Update CoreDNS versions" | |
body: Update CoreDNS versions with ${{ join(fromJSON(steps.emit-rockcraft.outputs.tags), ', ') }} | |
path: coredns-rock | |
branch: autoupdate/sync/coredns | |
delete-branch: true | |
base: main |