File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Major Release
2+
3+ permissions :
4+ issues : write
5+ contents : write
6+
7+ on :
8+ schedule :
9+ - cron : ' 0 0 15 * *'
10+
11+ jobs :
12+ create-issue :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Check for release schedule
17+ id : check-date
18+ run : |
19+ # Get the current month and day
20+ MONTH=$(date +'%m')
21+ DAY=$(date +'%d')
22+ # We'll create the reminder issue two months prior the release
23+ if [[ "$MONTH" == "02" || "$MONTH" == "08" ]] && [[ "$DAY" == "15" ]]; then
24+ echo "create_issue=true" >> $GITHUB_ENV
25+ release_date=$(date -d "$(date +%Y-%m-%d) +2 month" +"%d %B %Y")
26+ echo "RELEASE_DATE=$release_date" >> $GITHUB_ENV
27+ pr_max_date=$(date -d "$(date +%Y-%m-%d) +1 month" +"%d %B %Y")
28+ echo "PR_MAX_DATE=$pr_max_date" >> $GITHUB_ENV
29+ else
30+ echo "create_issue=false" >> $GITHUB_ENV
31+ fi
32+ - name : Create release announcement issue
33+ if : env.create_issue == 'true'
34+ run : |
35+ cat <<EOF > body.json
36+ {
37+ "title": "Upcoming Node.js Major Release",
38+ "body": "A reminder that the next Node.js **semver major release** is scheduled for **${RELEASE_DATE}**.\n
39+ Therefore, all commits that were landed until **${PR_MAX_DATE}** (one month prior to the release) will be included in the next semver major release.\n
40+
41+ Please ensure that any necessary preparations are made in advance.\n
42+ For more details on the release process, visit the [Node.js Release Working Group](https://github.com/nodejs/release).\n
43+
44+ cc: @nodejs/collaborators"
45+ }
46+ EOF
47+ curl --request POST \
48+ --url https://api.github.com/repos/${GITHUB_REPOSITORY}/issues \
49+ --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
50+ --header 'content-type: application/json' \
51+ --data @body.json
You can’t perform that action at this time.
0 commit comments