Mirror Repo #450
This file contains 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 Repo | |
on: | |
schedule: | |
# nightly (0th hour 0th minute of every day) | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Mirror | |
shell: bash | |
run: | | |
if [[ "$GITHUB_REPOSITORY_OWNER" != "brave" ]]; then | |
git clone "https://github.com/brave/${GITHUB_REPOSITORY#$GITHUB_REPOSITORY_OWNER/}" | |
cd ${GITHUB_REPOSITORY#$GITHUB_REPOSITORY_OWNER/} | |
git remote add github "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY.git" | |
git push -fu github main | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |