forked from openstack-k8s-operators/ci-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync_branches_reusable_workflow.yml
More file actions
40 lines (37 loc) · 1019 Bytes
/
sync_branches_reusable_workflow.yml
File metadata and controls
40 lines (37 loc) · 1019 Bytes
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
---
name: Sync a target branch with source branch
on:
workflow_call:
inputs:
source-branch:
required: true
type: string
target-branch:
required: true
type: string
secrets:
ssh-key:
description: 'Deploy token write access'
required: true
jobs:
sync-branches:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.ssh-key }}
persist-credentials: true
- name: Git config
run: |
git config --global user.name "openstack-k8s-ci-robot"
git config --global user.email "openstack-k8s@redhat.com"
- name: Rebase and Push
run: |
git fetch origin ${{ inputs.source-branch }}
git checkout ${{ inputs.target-branch }}
git rebase FETCH_HEAD
git push --force origin ${{ inputs.target-branch }}