Skip to content

Commit 7e4129a

Browse files
Bobbins228ChristianZaccaria
authored andcommitted
CARRY: Added Sync Fork workflow
1 parent 0d11d77 commit 7e4129a

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/sync-fork.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will create a sync pr for the opendatahub-io/codeflare-operator fork with project-codeflare/codeflare-operator
2+
3+
name: Create Sync Fork PR
4+
5+
on:
6+
workflow_dispatch:
7+
8+
jobs:
9+
create-fork-sync-pr:
10+
runs-on: ubuntu-latest
11+
12+
env:
13+
GIT_BRANCH: ${GITHUB_REF#refs/heads/}
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
persist-credentials: false
19+
- name: repo-sync
20+
uses: repo-sync/github-sync@v2
21+
with:
22+
source_repo: "https://github.com/project-codeflare/codeflare-operator.git"
23+
source_branch: ${{ env.GIT_BRANCH }}
24+
destination_branch: "sync-cfo-fork"
25+
github_token: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
26+
27+
- name: Set up Git
28+
run: |
29+
git config --global user.email "[email protected]"
30+
git config --global user.name "codeflare-machine-account"
31+
32+
- name: Create Pull Request
33+
run: |
34+
PR_TITLE="Sync with Upstream"
35+
PR_BODY="This pull request updates the fork to match the latest changes from the upstream repository."
36+
gh pr create --base "${{ env.GIT_BRANCH }}" --head sync-cfo-fork --title "$PR_TITLE" --body "$PR_BODY"
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
39+
shell: bash

0 commit comments

Comments
 (0)