build: pin all external github action to hash (#75) #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |