Mirror Repo #16
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 * * *' | |
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:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git" | |
git push -fu github main | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |