Skip to content

fix: rename all likedUsers to likedUser & add error handling #533

fix: rename all likedUsers to likedUser & add error handling

fix: rename all likedUsers to likedUser & add error handling #533

name: Sync with external repository
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.EXTERNAL_REPOSITORY_TOKEN }}
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || 'main' }}
- name: Add remote url
run: |
echo "Adding remote URL"
git remote add external-repository ${{ secrets.EXTERNAL_REPOSITORY_URL }}
git config user.name ${{ secrets.EXTERNAL_REPOSITORY_USERNAME }}
git config user.email ${{ secrets.EXTERNAL_REPOSITORY_EMAIL }}
- name: Push branch to external-repository
run: |
BRANCH_NAME=${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || 'main' }}
echo "Pushing branch $BRANCH_NAME to external-repository"
git push --force external-repository $BRANCH_NAME
- name: Clean up
run: |
echo "Removing external-repository remote"
git remote remove external-repository