-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (26 loc) · 1008 Bytes
/
mirror.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
name: Mirror
on:
push:
branches:
- master
jobs:
mirror:
if: github.repository != 'egnyte/secure-and-govern-for-splunk' && startsWith(github.repository, 'egnyte/')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Push to public repo
env:
MIRROR_TO_PUBLIC_PRIVATE_KEY: ${{ secrets.MIRROR_TO_PUBLIC_PRIVATE_KEY }}
run: |
# configure SSH client
eval $(ssh-agent -s)
echo "${MIRROR_TO_PUBLIC_PRIVATE_KEY}" | base64 -d | ssh-add -
mkdir ~/.ssh
echo "github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=" > ~/.ssh/known_hosts
# push the current branch
git remote add github [email protected]:egnyte/secure-and-govern-for-splunk.git
git push -u github $GITHUB_REF_NAME