Skip to content

Commit f25fe47

Browse files
committed
Adds GH action to sync branches
1 parent 3dc53b6 commit f25fe47

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Github Action to trigger downstream job
3+
on:
4+
issue_comment:
5+
types: [created, edited]
6+
7+
jobs:
8+
trigger_sync:
9+
if: contains(github.event.comment.body, '/sync-olive')
10+
uses: openstack-k8s-operators/ci-framework/.github/workflows/sync_branches_reusable_workflow.yml@main
11+
with:
12+
main-branch: main
13+
follower-branch: olive
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Github Action to trigger downstream job
3+
on:
4+
schedule:
5+
- cron: '0 1 * * 4'
6+
7+
jobs:
8+
trigger_sync:
9+
if: contains(github.event.comment.body, '/sync-olive')
10+
uses: openstack-k8s-operators/ci-framework/.github/workflows/sync_branches_reusable_workflow.yml@main
11+
with:
12+
main-branch: main
13+
follower-branch: olive
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Sync Olive 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
21+
uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Update the follower branch
26+
run: |
27+
git checkout ${{ inputs.main-branch }}
28+
git fetch origin
29+
git checkout ${{ inputs.follower-branch }}
30+
git pull
31+
git rebase origin/${{ inputs.main-branch }}
32+
git push origin ${{ inputs.follower-branch }}

0 commit comments

Comments
 (0)