Skip to content

Commit 92dafd4

Browse files
authored
ci(node): add weekly workflow to refresh release schedule (#243)
1 parent 3aaeef4 commit 92dafd4

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Refresh Node.js Schedule
2+
3+
on:
4+
# Run weekly to pick up upstream changes (e.g., new major lines, revised EOL dates)
5+
schedule:
6+
- cron: '0 6 * * 1' # Every Monday at 6 AM UTC
7+
# Manual trigger
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
refresh:
15+
name: Refresh Node.js release schedule
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
token: ${{ secrets.CONTRIBUTORS_TOKEN }}
23+
24+
- name: Download upstream schedule
25+
run: |
26+
curl -fsSL \
27+
https://raw.githubusercontent.com/nodejs/Release/main/schedule.json \
28+
-o src/runtimes/node/data/schedule.json
29+
30+
- name: Check for changes
31+
id: check-changes
32+
run: |
33+
if git diff --quiet src/runtimes/node/data/schedule.json; then
34+
echo "changed=false" >> "$GITHUB_OUTPUT"
35+
else
36+
echo "changed=true" >> "$GITHUB_OUTPUT"
37+
fi
38+
39+
- name: Commit and push changes
40+
if: ${{ steps.check-changes.outputs.changed == 'true' }}
41+
run: |
42+
git config user.name "github-actions[bot]"
43+
git config user.email "github-actions[bot]@users.noreply.github.com"
44+
git add src/runtimes/node/data/schedule.json
45+
git commit -m "chore(node): refresh upstream release schedule"
46+
git push
47+
48+
- name: Generate summary
49+
if: always()
50+
run: |
51+
echo "## Node.js Release Schedule Refresh" >> "$GITHUB_STEP_SUMMARY"
52+
echo "" >> "$GITHUB_STEP_SUMMARY"
53+
if [ "${{ steps.check-changes.outputs.changed }}" = "true" ]; then
54+
echo "**Result:** Schedule updated from upstream and committed to main." >> "$GITHUB_STEP_SUMMARY"
55+
else
56+
echo "**Result:** No changes — embedded schedule is in sync with upstream." >> "$GITHUB_STEP_SUMMARY"
57+
fi

0 commit comments

Comments
 (0)