Skip to content

Commit 7006aad

Browse files
chore: adding workflow to mirror repo to mattrassurance org
1 parent f430939 commit 7006aad

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Mirror repository to mattrassurance org
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
9+
jobs:
10+
MirrorRepoToMATTRAssurance:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
id-token: write
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: mirror repo
20+
run: |
21+
rm -r .git
22+
rm -r .github
23+
git init --initial-branch=${{ github.ref_name }}
24+
git config --local user.name ${{ secrets.MATTRASSURANCE_GIT_USER_NAME }}
25+
git config --local user.email ${{ secrets.MATTRASSURANCE_GIT_USER_EMAIL }}
26+
git add .
27+
git commit -m "Backing up ${{ github.repository }} to mattrassurance org"
28+
git remote add origin https://${{ secrets.MATTRASSURANCE_GIT_USER_NAME }}:${{ secrets.MATTRASSURANCE_GIT_USER_PAT }}@github.com/mattrassurance/${{ github.event.repository.name }}.git
29+
git push origin ${{ github.ref_name }} --force

0 commit comments

Comments
 (0)