Skip to content

Commit

Permalink
Update sync-to-private-repo.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nsswifter authored Dec 1, 2024
1 parent a8defd8 commit 09dbb26
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions .github/workflows/sync-to-private-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,27 @@ name: Sync to Private Repo
on:
push:
branches:
- main # Change this if your main branch has a different name
- main # Change this to match your default branch

jobs:
sync:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the public repository
- name: Checkout Public Repository
uses: actions/checkout@v3
# Step 1: Check out the public repository
- name: Checkout Public Repository
uses: actions/checkout@v3

# Step 2: Configure SSH to access the private repository
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.PRIVATE_REPO_SSH_KEY }}
# Step 2: Configure Git to use Personal Access Token (PAT)
- name: Configure Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
# Step 3: Add the private repository as a remote
- name: Add Private Repository as Remote
run: |
git remote add private [email protected]:nsswifter/AcademicApplicationDocuments.git
git fetch private
# Step 4: Push changes to the private repository
- name: Sync Changes to Private Repository
run: |
git push private main
# Step 3: Add the private repository as a remote and sync changes
- name: Sync Changes to Private Repository
env:
PAT: ${{ secrets.PRIVATE_REPO_PAT }}
run: |
git remote add private https://x-access-token:${PAT}@github.com/nsswifter/AcademicApplicationDocuments.git
git push private main

0 comments on commit 09dbb26

Please sign in to comment.