Skip to content

build: pin all external github action to hash (#75) #15

build: pin all external github action to hash (#75)

build: pin all external github action to hash (#75) #15

name: Mirror repository to mattrassurance org
on:
workflow_dispatch:
push:
branches:
- master
- main
jobs:
MirrorRepoToMATTRAssurance:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # pin@v5.0.0
- name: mirror repo
run: |
rm -r .git
rm -r .github
git init --initial-branch=${{ github.ref_name }}
git config --local user.name ${{ secrets.MATTRASSURANCE_GIT_USER_NAME }}
git config --local user.email ${{ secrets.MATTRASSURANCE_GIT_USER_EMAIL }}
git add .
git commit -m "Backing up ${{ github.repository }} to mattrassurance org"
git remote add origin https://${{ secrets.MATTRASSURANCE_GIT_USER_NAME }}:${{ secrets.MATTRASSURANCE_GIT_USER_PAT }}@github.com/mattrassurance/${{ github.event.repository.name }}.git
git push origin ${{ github.ref_name }} --force