Skip to content

Commit ac52dce

Browse files
committed
[Test of] Adds GH action to sync branches
1 parent 5264230 commit ac52dce

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Periodically sync branches
3+
on:
4+
schedule:
5+
- cron: '0 21 * * 1'
6+
7+
jobs:
8+
trigger_sync:
9+
uses: openstack-k8s-operators/ci-framework/.github/workflows/sync_branches_reusable_workflow.yml@main
10+
with:
11+
main-branch: main
12+
follower-branch: ananya-do-not-use-tmp
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Sync a follower branch with Main
3+
on:
4+
workflow_call:
5+
inputs:
6+
main-branch:
7+
required: true
8+
type: string
9+
follower-branch:
10+
required: true
11+
type: string
12+
13+
jobs:
14+
sync:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
pull-requests: write
19+
steps:
20+
- name: Checkout main branch
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
ref:
25+
${{ inputs.main-branch }}
26+
27+
- name: Checkout, rebase and push to follower branch
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
ref:
32+
${{ inputs.follower-branch }}
33+
- run: |
34+
# Details about the GH action bot comes from
35+
# https://api.github.com/users/github-actions%5Bbot%5D
36+
git config user.name "github-actions[bot]"
37+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
38+
git rebase origin/${{ inputs.main-branch }}
39+
git push origin ${{ inputs.follower-branch }}

0 commit comments

Comments
 (0)