-
Notifications
You must be signed in to change notification settings - Fork 113
52 lines (46 loc) · 1.62 KB
/
sync-branches.yml
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
name: 'Sync branches'
on:
schedule:
- cron: '0 0 * * 1' # Run at the start of every monday
workflow_dispatch: # Allow manually invoking this workflow
permissions: {}
env:
base_branch: 'origin/main'
jobs:
sync-branch:
if: github.repository == 'dotnet/dotnet-monitor'
strategy:
matrix:
branch: ["release/6.x", "release/7.x", "release/8.0"]
name: 'Sync ${{ matrix.branch }}'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
persist-credentials: true # We need to persist credentials to push the resulting changes upstream.
fetch-depth: 0 # Fetch the entire repo for the below git operations
ref: ${{ matrix.branch }}
- name: Sync branch
run: |
git checkout "$base_branch" -- \
".github" \
".devcontainer" \
".vscode" \
"eng/actions" \
"cspell.json" \
"documentation/**.md"
- name: Open PR
uses: ./.github/actions/open-pr
with:
files_to_commit: "*"
title: '[${{ matrix.branch }}] Sync branch with ${{ env.base_branch }}'
commit_message: sync branch with ${{ env.base_branch }}
body: Sync branch with ${{ env.base_branch }}. This PR was auto generated and will not be automatically merged in.
branch_name: sync/${{ matrix.branch }}
fail_if_files_unchanged: false
labels: 'automatic-pr'
auth_token: ${{ secrets.GITHUB_TOKEN }}