mirror of
https://github.com/browsermt/bergamot-translator.git
synced 2024-09-11 05:35:33 +03:00
GitHub action to push browsermt/main branch to mozilla/bergamot-translator every hour (#160)
* Create push-browsermt-main-to-mozilla-main.yml * Update .github/workflows/push-browsermt-main-to-mozilla-main.yml Co-authored-by: Graeme <graemenail@gmail.com> * Tweaks * Fix yaml syntax * Parametrized the workflow based on @jerinphilip's example Co-authored-by: Graeme <graemenail@gmail.com>
This commit is contained in:
parent
0f8f8e026a
commit
4b177d57e4
27
.github/workflows/push-browsermt-main-to-mozilla-main.yml
vendored
Normal file
27
.github/workflows/push-browsermt-main-to-mozilla-main.yml
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
name: Push browsermt/main branch to mozilla/bergamot-translator
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Run every hour
|
||||
- cron: "0 * * * *"
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
name: Mirror a branch from a remote repo into this one
|
||||
env:
|
||||
source_repository: 'browsermt/bergamot-translator'
|
||||
this_repository: 'mozilla/bergamot-translator'
|
||||
branch: 'main'
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Mirror a branch from a remote repo into this one
|
||||
if: github.repository == '${{ env.this_repository }}'
|
||||
run: |
|
||||
git clone -b ${{ env.branch }} https://github.com/${{ env.source_repository }}.git source
|
||||
cd source
|
||||
git remote add mirror https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ env.this_repository }}.git
|
||||
git push mirror ${{ env.branch }}
|
Loading…
Reference in New Issue
Block a user