Skip to content

Commit 216d42f

Browse files
seshubawsvalerena
andauthored
chore: action to sync to mirror repo (#8670)
* action to sync to mirror repo * update checkout dep * update job name Co-authored-by: Renato Valenzuela <37676028+valerena@users.noreply.github.com> --------- Co-authored-by: Renato Valenzuela <37676028+valerena@users.noreply.github.com>
1 parent 8b878af commit 216d42f

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "Sync to Mirror Repo"
2+
3+
on:
4+
schedule:
5+
# Run twice daily at 3am and 3pm PST
6+
- cron: '0 11,23 * * *'
7+
workflow_dispatch: # Allow manual trigger
8+
9+
jobs:
10+
sync-from-public:
11+
runs-on: ubuntu-latest
12+
if: github.repository != 'aws/aws-sam-cli' # Only run in mirror repo
13+
steps:
14+
- name: Checkout public repo
15+
uses: actions/checkout@v6
16+
with:
17+
repository: aws/aws-sam-cli
18+
ref: develop
19+
fetch-depth: 0
20+
21+
- name: Push to mirror repo
22+
run: |
23+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
24+
git push origin develop:develop --force-with-lease

0 commit comments

Comments
 (0)