Skip to content

Commit 9ebf202

Browse files
Update upcoming_api_releases.sh
1 parent 98ec78f commit 9ebf202

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/scripts/upcoming_api_releases.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
#!/bin/bash
22
set -eou pipefail
33

4+
# This script checks for upcoming API version releases within the next 3 weeks.
5+
# It performs the following steps:
6+
# 1. Fetches and oarse the `versions.json` file using in the `mongodb/openapi` repository deom the `dev` branch
7+
# 2. Gets the current date in seconds since epoch.
8+
# 3. Determines if the system is macOS or Linux to use the appropriate `date` command format.
9+
# 4. Iterates through each date in the `version_dates`:
10+
# a. Converts the date to seconds since epoch.
11+
# b. Calculates the difference in days between the date and the current date.
12+
# c. Checks if the date is within 3 weeks (21 days) and adds it to the list if it is.
13+
# 5. Outputs the API versions that will be released in the next 3 weeks to the GitHub Actions output variable if any are found.
14+
415

516
URL="https://raw.githubusercontent.com/mongodb/openapi/dev/openapi/v2/versions.json"
617

0 commit comments

Comments
 (0)