File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 2323 - name : Run CI tests
2424 run : npm test
2525 working-directory : ./tools
26+
27+ - name : Check RP in Autogenlist
28+ run : npm run find-basepath ${{ github.head_ref }}
29+ working-directory : ./generator
30+
31+ - name : automerge
32+ uses : " pascalgn/automerge-action@v0.12.0"
33+ env :
34+ GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
35+ MERGE_LABELS : " "
Original file line number Diff line number Diff line change 1+ import { executeSynchronous } from '../utils' ;
2+ import { findAutogenEntries } from '../autogenlist' ;
3+
4+ // this function analyzes a branch name and extracts the base path, then proceeds to find it in autogenlist
5+ // if not found, it throws an error
6+ executeSynchronous ( async ( ) => {
7+ if ( ! process . argv [ 2 ] ) {
8+ throw new Error ( "Branch name missing. This cmd expects a branch name with the following format: 'AzureSDKAutomation:sdkAutomation/[basepath]'" ) ;
9+ }
10+
11+ const prName = process . argv [ 2 ] ;
12+ let basePath = prName . replace ( "AzureSDKAutomation:sdkAutomation/" , "" ) ;
13+
14+ // format basePath
15+ basePath = `${ basePath } /resource-manager` ;
16+
17+ const autogenEntries = findAutogenEntries ( basePath ) ;
18+
19+ if ( autogenEntries . length === 0 ) {
20+ //not found
21+ throw new Error ( `Base path: '${ basePath } ' not found in autogenlist, this means RP hasn't been onboarded in schema autogeneration process yet.` )
22+ }
23+
24+ console . log ( `Base path: '${ basePath } found in autogenlist.` ) ;
25+ } ) ;
Original file line number Diff line number Diff line change 66 "list-basepaths" : " ts-node cmd/listbasepaths" ,
77 "list-resources" : " ts-node cmd/listresources" ,
88 "generate-all" : " ts-node cmd/generateall" ,
9+ "find-basepath" : " ts-node cmd/findbasepath" ,
910 "generate-single" : " ts-node cmd/generatesingle" ,
1011 "clean" : " ts-node cmd/clean" ,
1112 "start" : " npm run clean && npm run generate-all" ,
You can’t perform that action at this time.
0 commit comments