File tree Expand file tree Collapse file tree 2 files changed +61
-0
lines changed
Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Sync Merged PR to Monorepo
2+
3+ on :
4+ pull_request :
5+ types : [closed]
6+ branches :
7+ - main
8+ - master
9+
10+ jobs :
11+ sync-to-monorepo :
12+ if : github.event.pull_request.merged == true
13+ runs-on : ubuntu-latest
14+ env :
15+ GH_TOKEN : ${{ secrets.MONOREPO_SYNC_TOKEN }}
16+ PR_NUMBER : ${{ github.event.pull_request.number }}
17+ PR_TITLE : ${{ github.event.pull_request.title }}
18+ PR_AUTHOR : ${{ github.event.pull_request.user.login }}
19+ SOURCE_REPO_NAME : ${{ github.event.repository.name }}
20+ MONOREPO_PACKAGE_LOCATION : packages/${{ github.event.repository.name }}
21+ MONOREPO_PATH : ${{ github.workspace }}/monorepo
22+
23+ steps :
24+ - name : Checkout repository
25+ uses : actions/checkout@v4
26+ with :
27+ fetch-depth : 1
28+
29+ - name : Setup Node.js
30+ uses : actions/setup-node@v4
31+ with :
32+ node-version : ' 18'
33+
34+ - name : Install dependencies
35+ # Install project dependencies (including dev dependencies)
36+ run : npm install
37+ - name : Install zx
38+ run : npm install zx
39+
40+ - name : Install monorepo-sync package
41+ run : npm install git+https://github.com/formio/monorepo-sync.git
42+ - name : Clone Monorepo
43+ run : |
44+ gh repo clone formio/formio-monorepo monorepo -- --depth=1
45+
46+ - name : Sync to Monorepo
47+ run : |
48+ echo "Syncing PR #${PR_NUMBER}: ${PR_TITLE}"
49+ node .github/workflows/sync-monorepo.mjs
Original file line number Diff line number Diff line change 1+ import { syncFromGithubAction } from 'monorepo-sync' ;
2+
3+ syncFromGithubAction ( )
4+ . then ( ( ) => {
5+ console . log ( 'Sync completed successfully' ) ;
6+ process . exit ( 0 ) ;
7+ } )
8+ . catch ( ( error ) => {
9+ console . error ( 'Error during sync:' , error ) ;
10+ process . exit ( 1 ) ;
11+ } ) ;
12+
You can’t perform that action at this time.
0 commit comments