forked from kubernetes-sigs/external-dns
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 2.09 KB
/
sync-upstream.yaml
File metadata and controls
56 lines (47 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Sync with Upstream
on:
schedule:
# Runs at 05:00 UTC every day
- cron: '0 5 * * *'
workflow_dispatch:
jobs:
sync:
name: Sync Fork
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Set up Git
id: merge
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git remote add upstream https://github.com/kubernetes-sigs/external-dns.git
git fetch upstream --tags
LATEST_TAG=$(git tag -l 'v*' --sort=v:refname | tail -n 1)
echo "Latest upstream tag is ${LATEST_TAG}"
# Merge the latest tag, but keep our version of the .github directory
git merge --no-commit upstream "${LATEST_TAG}" || true
git reset HEAD .github
rm -rf .github
git checkout HEAD -- .github
git commit -m "chore: sync with upstream kubernetes-sigs/external-dns ${LATEST_TAG}"
echo "latest_tag=${LATEST_TAG}" >> "${GITHUB_OUTPUT}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
commit-message: "chore: sync with upstream kubernetes-sigs/external-dns ${{ steps.merge.outputs.latest_tag }}"
committer: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
branch: "chore/sync-upstream-${{ steps.merge.outputs.latest_tag }}"
delete-branch: true
title: "chore: sync with upstream `kubernetes-sigs/external-dns` ${{ steps.merge.outputs.latest_tag }}"
body: |
This PR is auto-generated and syncs changes from the upstream `kubernetes-sigs/external-dns` repository.
labels: "automated-pr, chore"
base: "main"