File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,18 @@ const __dirname = path.dirname(__filename);
88// Standalone specs can be added directly to the mapping. Any spec that requires displaying a version dropdown
99// will need to map its different versions to a separate Bump "branch". For example, a new resource version
1010// for Atlas Admin API v2 will lead to a new entry in the array with its own Bump branch.
11- const SPEC_MAPPING = [
12- {
13- doc : process . env . ATLAS_ADMIN_V1_DOC_ID ,
14- file : 'v1-deprecated/v1.json' ,
15- branch : 'main' ,
16- } ,
17- ] ;
11+ const SPEC_MAPPING = [ ] ;
12+
13+ function handleAdminAPIv1 ( ) {
14+ // We release v1-deprecated/v1.json only for the main branch (PROD)
15+ if ( process . env . BRANCH_NAME === 'main' ) {
16+ SPEC_MAPPING . push ( {
17+ doc : process . env . ATLAS_ADMIN_V1_DOC_ID ,
18+ file : 'v1-deprecated/v1.json' ,
19+ branch : 'main' ,
20+ } ) ;
21+ }
22+ }
1823
1924function handleAdminAPIv2 ( ) {
2025 const docId = process . env . ATLAS_ADMIN_V2_DOC_ID ;
@@ -54,6 +59,7 @@ function handleAdminAPIv2() {
5459 }
5560}
5661
62+ handleAdminAPIv1 ( ) ;
5763handleAdminAPIv2 ( ) ;
5864// Output to GH action
5965console . log ( JSON . stringify ( SPEC_MAPPING ) ) ;
Original file line number Diff line number Diff line change 5050 env :
5151 ATLAS_ADMIN_V1_DOC_ID : ${{ inputs.atlas_admin_v1_doc_id }}
5252 ATLAS_ADMIN_V2_DOC_ID : ${{ inputs.atlas_admin_v2_doc_id }}
53+ BRANCH_NAME : ${{ inputs.branch}}
5354 run : |
5455 spec_mapping=$(node release-scripts/generateSpecMapping.js)
5556 echo "matrix=${spec_mapping}" >> "${GITHUB_OUTPUT}"
You can’t perform that action at this time.
0 commit comments