Skip to content

Commit a72fcf6

Browse files
fix: fix bump release - part 4 (#763)
1 parent 5d0c12f commit a72fcf6

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

.github/scripts/generateSpecMapping.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff 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

1924
function handleAdminAPIv2() {
2025
const docId = process.env.ATLAS_ADMIN_V2_DOC_ID;
@@ -54,6 +59,7 @@ function handleAdminAPIv2() {
5459
}
5560
}
5661

62+
handleAdminAPIv1();
5763
handleAdminAPIv2();
5864
// Output to GH action
5965
console.log(JSON.stringify(SPEC_MAPPING));

.github/workflows/generate-bump-pages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
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}"

0 commit comments

Comments
 (0)