Skip to content

Fetch JDK Links

Fetch JDK Links #12

name: Fetch JDK Links
on:
schedule:
- cron: '0 0 * * 1' # Every Monday at 00:00 UTC (8:00 AM Beijing)
- cron: '0 0 * * 4' # Every Thursday at 00:00 UTC (8:00 AM Beijing)
workflow_dispatch: # Allow manual trigger
push:
paths:
- 'landing-page/scripts/**'
- '.github/workflows/fetch-jdk-links.yml'
jobs:
fetch-and-update:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Fetch JDK links
run: |
cd landing-page
node scripts/fetch-jdk-links.js
- name: Check for changes
id: git-check
run: |
git diff --exit-code landing-page/data/jdk.json || echo "changed=true" >> $GITHUB_OUTPUT
- name: Commit and push if changed
if: steps.git-check.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add landing-page/data/jdk.json
git commit -m "chore(data): update JDK links [skip ci]"
git push