Skip to content

Commit f3678be

Browse files
committed
Add github action for private to public
1 parent 79f9fe0 commit f3678be

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Sync to Public Repo
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
git-sync:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Private Repo
13+
uses: actions/checkout@v5
14+
with:
15+
fetch-depth: 0
16+
# This prevents the default GitHub token from overriding your PAT
17+
persist-credentials: false
18+
19+
- name: Push to Public Mirror
20+
env:
21+
PUBLIC_TOKEN: ${{ secrets.PUBLIC_REPO_TOKEN }}
22+
run: |
23+
# Use the 'oauth2' prefix which is often more reliable for fine-grained tokens
24+
git remote add public https://oauth2:${PUBLIC_TOKEN}@github.com/Pico-Developer/SecureMR-Samples.git
25+
git push public main --force

0 commit comments

Comments
 (0)