chore: update GitHub Actions workflow to sync with nuxt-start repo an… #2
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
# @format | |
name: Sync Repos | |
on: | |
push: | |
branches: | |
- main | |
# You can add more triggers, such as scheduled events | |
# schedule: | |
# - cron: '0 0 * * *' | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source repository | |
uses: actions/checkout@v2 | |
- name: Push to destination repository | |
run: | | |
git config --global user.email "$GIT_EMAIL" | |
git config --global user.name "$GIT_USERNAME" | |
git clone https://${{ env.ORG_NAME }}:${{ secrets.PAT }}@github.com/${{ env.ORG_NAME }}/nuxt-start.git | |
cd nuxt-start | |
git remote add ${{ env.ORIGINAL_REPO_NAME }} https://${{ env.ORG_NAME }}:${{ secrets.PAT }}@github.com/${{ env.ORG_NAME }}/${{ env.ORIGINAL_REPO_NAME }}.git | |
git remote update | |
git merge ${{ env.ORIGINAL_REPO_NAME }}/main | |
git push origin main | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
ORIGINAL_REPO_NAME: ${{ github.event.repository.name }} | |
ORG_NAME: Hoverla-Soft |