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);
8
8
// Standalone specs can be added directly to the mapping. Any spec that requires displaying a version dropdown
9
9
// will need to map its different versions to a separate Bump "branch". For example, a new resource version
10
10
// 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
+ }
18
23
19
24
function handleAdminAPIv2 ( ) {
20
25
const docId = process . env . ATLAS_ADMIN_V2_DOC_ID ;
@@ -54,6 +59,7 @@ function handleAdminAPIv2() {
54
59
}
55
60
}
56
61
62
+ handleAdminAPIv1 ( ) ;
57
63
handleAdminAPIv2 ( ) ;
58
64
// Output to GH action
59
65
console . log ( JSON . stringify ( SPEC_MAPPING ) ) ;
Original file line number Diff line number Diff line change 50
50
env :
51
51
ATLAS_ADMIN_V1_DOC_ID : ${{ inputs.atlas_admin_v1_doc_id }}
52
52
ATLAS_ADMIN_V2_DOC_ID : ${{ inputs.atlas_admin_v2_doc_id }}
53
+ BRANCH_NAME : ${{ inputs.branch}}
53
54
run : |
54
55
spec_mapping=$(node release-scripts/generateSpecMapping.js)
55
56
echo "matrix=${spec_mapping}" >> "${GITHUB_OUTPUT}"
You can’t perform that action at this time.
0 commit comments