Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/sync_branches_periodically.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Periodically sync branches
on:
schedule:
- cron: '0 21 * * 1'

jobs:
trigger_sync:
uses: openstack-k8s-operators/ci-framework/.github/workflows/sync_branches_reusable_workflow.yml@main
with:
main-branch: main
follower-branch: ananya-do-not-use-tmp
39 changes: 39 additions & 0 deletions .github/workflows/sync_branches_reusable_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Sync a follower branch with Main
on:
workflow_call:
inputs:
main-branch:
required: true
type: string
follower-branch:
required: true
type: string

jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
fetch-depth: 0
ref:
${{ inputs.main-branch }}

- name: Checkout, rebase and push to follower branch
uses: actions/checkout@v4
with:
fetch-depth: 0
ref:
${{ inputs.follower-branch }}
- run: |
# Details about the GH action bot comes from
# https://api.github.com/users/github-actions%5Bbot%5D
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git rebase origin/${{ inputs.main-branch }}
git push origin ${{ inputs.follower-branch }}