Skip to content

Commit

Permalink
chore: update auto-sync.yml to use vars
Browse files Browse the repository at this point in the history
  • Loading branch information
hrynevychroman committed Aug 16, 2024
1 parent 21620d1 commit e80cfd2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/auto-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@ jobs:

- 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 }}/${{ env.ORIGINAL_REPO_NAME }}.git
git config --global user.email "${{ vars.GIT_EMAIL }}"
git config --global user.name "${{ vars.GIT_USERNAME }}"
git clone https://${{ vars.ORG_NAME }}:${{ env.GITHUB_TOKEN }}@github.com/${{ vars.ORG_NAME }}/${{ env.ORIGINAL_REPO_NAME }}.git
cd ${{ env.ORIGINAL_REPO_NAME }}
git remote add ${{ env.ORIGINAL_REPO_NAME }} https://${{ env.GIT_USERNAME }}:${{ secrets.PAT }}@github.com/${{ env.GIT_USERNAME }}/${{ env.ORIGINAL_REPO_NAME }}.git
git remote add ${{ env.ORIGINAL_REPO_NAME }} https://${{ vars.GIT_USERNAME }}:${{ env.GITHUB_TOKEN }}@github.com/${{ vars.GIT_USERNAME }}/${{ env.ORIGINAL_REPO_NAME }}.git
git remote update
git merge ${{ env.ORIGINAL_REPO_NAME }}/main --allow-unrelated-histories
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
ORIGINAL_REPO_NAME: ${{ github.event.repository.name }}
ORG_NAME: Hoverla-Soft
GIT_USERNAME: romanhrynevych

0 comments on commit e80cfd2

Please sign in to comment.