-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (36 loc) · 1.63 KB
/
reposync.yaml
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
41
42
43
44
45
46
47
48
49
name: ent-repo-sync
# Controls when the workflow will run
on:
push:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
sync:
runs-on: ubuntu-latest
steps:
- run: |
export ENTERPRISE_REPO="https://github.com/kamal-devtron/testing.git"
git clone https://github.com/kamal-devtron/action-testing.git
git clone $ENTERPRISE_REPO
cd action-testing && export GIT_COMMIT_ID=`git log --format="%H" -n 1`
export GIT_COMMIT=${GIT_COMMIT_ID:0:8}
echo $GIT_COMMIT
git config --global user.email $GIT_CONFIG_EMAIL
git config --global user.name $GIT_USERNAME
git status && git checkout main && git pull && rm -rf .github
cd ../testing && git status && git checkout main && git pull
git branch | grep release-candidate
k=$(echo $?)
if [ $k == 1 ]
then
git checkout -b release-candidate
else
echo "Branch exsist"
git remote add oss-devtron ../devtron && git remote -v && git remote update && git merge oss-devtron/main
git commit -m "OSS main synced" && git status
git checkout -b oss-enterprise-sync-$GIT_COMMIT && git push -u origin oss-enterprise-sync-$GIT_COMMIT
PR_RESPONSE=$(gh pr create --title "SYNC: OSS sync for $GIT_COMMIT" --fill --base main --head oss-enterprise-sync-$GIT_COMMIT --repo $ENTERPRISE_REPO)
echo "FINAL PR RESPONSE: $PR_RESPONSE"