Skip to content

Create PRs for new CoreDNS versions #245

Create PRs for new CoreDNS versions

Create PRs for new CoreDNS versions #245

name: Create PRs for new CoreDNS versions
on:
workflow_dispatch:
schedule:
- cron: "0 10 * * *"
pull_request:
branches:
- main
permissions:
contents: read
jobs:
generator:
permissions:
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR
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' }}
ssh-key: ${{ secrets.BOT_SSH_KEY }}
- 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
labels: |
automerge
delete-branch: true
base: main