forked from BeOpen-project/minio-sql-connector
-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (43 loc) · 1.6 KB
/
sync-qe-suite.yml
File metadata and controls
52 lines (43 loc) · 1.6 KB
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
50
51
52
name: Sync Query Engine
on:
push:
branches-ignore:
- main
workflow_dispatch:
jobs:
push-subtrees:
runs-on: ubuntu-latest
steps:
- name: Checkout fullstack
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup SSH
uses: webfactory/ssh-agent@v0.9.1
with:
ssh-private-key: ${{ secrets.QUERY_ENGINE_SUITE_KEY }}
- name: Set Git user
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Set branch name
run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Clone suite
run: |
cd ..
git clone git@github.com:OPSILab/query-engine-suite.git
cd query-engine-suite
- name: Add qe remote
run: git remote add qe-remote git@github.com:OPSILab/query-engine.git || echo "Remote already exists"
- name: Pull latest from subtree
run: |
git subtree pull --prefix=Query-Engine qe-remote ${{ env.BRANCH_NAME }} --squash || echo "No changes to pull"
- name: Push branch / create branch if needed
run: |
if git ls-remote --heads origin ${{ env.BRANCH_NAME }} | grep -q ${{ env.BRANCH_NAME }}; then
echo "Branch exists on remote, pushing subtree..."
git push origin ${{ env.BRANCH_NAME }}
else
echo "Branch does not exist on remote, creating branch..."
git push origin HEAD:refs/heads/${{ env.BRANCH_NAME }}
fi