-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.45 KB
/
sync_client_to_main_repository.yml
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
name: sync client to main repository
on:
push:
branches:
- develop
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Github main repository
uses: actions/checkout@v3
with:
repository: ablej-ssafy/ai-headhunting
token: ${{ secrets.GIT_TOKEN }}
fetch-depth: 0
- name: Checkout client repository
uses: actions/checkout@v3
with:
repository: ablej-ssafy/client
path: temp_client
fetch-depth: 0
- name: Get client last commit author
id: get-author
working-directory: temp_client
run: echo "author=$(git log -1 --pretty=format:'%an')" >> $GITHUB_OUTPUT
- name: Get client last commit author email
id: get-author-email
working-directory: temp_client
run: echo "email=$(git log -1 --pretty=format:'%ae')" >> $GITHUB_OUTPUT
- name: Configure Git
run: |
git config --global user.name "${{ steps.get-author.outputs.author }}"
git config --global user.email "${{ steps.get-author-email.outputs.email }}"
- name: Add client as subtree
run: |
git remote add client https://github.com/ablej-ssafy/client.git
git fetch client develop
git subtree pull --prefix=client client develop --message "Sync client to main repository"
- name: Push changes to Github
run: |
git push origin develop