From 21d59a7dbf3390ca841ea41024bdb6b830d04c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Ara=C3=BAjo?= Date: Fri, 29 Aug 2025 18:57:44 -0300 Subject: [PATCH 1/5] ci: regenerate release svg automatically --- .github/workflows/schedule.yml | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/schedule.yml diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml new file mode 100644 index 0000000..c209aa5 --- /dev/null +++ b/.github/workflows/schedule.yml @@ -0,0 +1,64 @@ +name: Update Release Schedule SVG + +on: + schedule: + - cron: "0 9 * * 1" # Every Monday at 9:00 AM UTC + workflow_dispatch: + +permissions: + contents: write + +jobs: + update-schedule-svg: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "22" + + - name: Generate and optimize schedule SVG + shell: bash + env: + SCHEDULE_JSON: ${{ github.workspace }}/schedule.json + SCHEDULE_SVG: ${{ github.workspace }}/schedule.svg + run: | + # Calculate date range + START_DATE=$(date -d "3 months ago" +%Y-%m-%d) + END_DATE=$(date -d "18 months" +%Y-%m-%d) + echo "Generating SVG from $START_DATE to $END_DATE" + + # Generate SVG (output to schedule.svg) + npx lts -s "$START_DATE" -e "$END_DATE" -d "$SCHEDULE_JSON" -g "$SCHEDULE_SVG" + + # Optimize SVG + npx svgo "$SCHEDULE_SVG" + + - name: Check for changes in schedule.svg + id: git_check + run: | + if git diff --quiet schedule.svg; then + echo "changed=false" >> "$GITHUB_OUTPUT" + else + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: Commit and push changes + if: steps.git_check.outputs.changed == 'true' + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add schedule.svg + git commit -m "chore: update release schedule svg" + git push + + - name: Create workflow summary + run: | + if [[ "${{ steps.git_check.outputs.changed }}" == "true" ]]; then + echo "✅ Schedule SVG updated successfully" >> "$GITHUB_STEP_SUMMARY" + else + echo "ℹ️ No changes detected in schedule SVG" >> "$GITHUB_STEP_SUMMARY" + fi From 8ad6d750a4193ec77dc61bc8b53018e7f3d1bd59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Ara=C3=BAjo?= Date: Sat, 30 Aug 2025 11:53:21 -0300 Subject: [PATCH 2/5] ci: run when schedule.json changes --- .github/workflows/schedule.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml index c209aa5..fcb8e4c 100644 --- a/.github/workflows/schedule.yml +++ b/.github/workflows/schedule.yml @@ -3,6 +3,9 @@ name: Update Release Schedule SVG on: schedule: - cron: "0 9 * * 1" # Every Monday at 9:00 AM UTC + push: + paths: + - "schedule.json" workflow_dispatch: permissions: From 03b7bd6c415b903cfaf69ab35d6164c4da6c8477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Ara=C3=BAjo?= Date: Sat, 30 Aug 2025 11:56:34 -0300 Subject: [PATCH 3/5] ci: pin actions --- .github/workflows/schedule.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml index fcb8e4c..11872d2 100644 --- a/.github/workflows/schedule.yml +++ b/.github/workflows/schedule.yml @@ -16,10 +16,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: "22" From 2f861997dbbe09aa378c91a83b9c205de6807f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Ara=C3=BAjo?= Date: Tue, 2 Sep 2025 11:01:37 -0300 Subject: [PATCH 4/5] ci: create pr automatic --- .github/workflows/schedule.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml index 11872d2..c2b6bb8 100644 --- a/.github/workflows/schedule.yml +++ b/.github/workflows/schedule.yml @@ -49,14 +49,19 @@ jobs: echo "changed=true" >> "$GITHUB_OUTPUT" fi - - name: Commit and push changes + - name: Create Pull Request if: steps.git_check.outputs.changed == 'true' - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add schedule.svg - git commit -m "chore: update release schedule svg" - git push + uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 + with: + token: ${{ secrets.GH_API_TOKEN }} + author: "Node.js GitHub Bot " + branch: update-branch + base: main + commit-message: "feat: Node.js ${{ steps.updt.outputs.result }}" + title: "chore: update release svg" + delete-branch: true + team-reviewers: | + nodejs/releasers - name: Create workflow summary run: | From 757d34088b6c1fefb3611a217c9e07ed25552705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Ara=C3=BAjo?= Date: Tue, 2 Sep 2025 11:03:00 -0300 Subject: [PATCH 5/5] ci: pin packages --- .github/workflows/schedule.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml index c2b6bb8..8588507 100644 --- a/.github/workflows/schedule.yml +++ b/.github/workflows/schedule.yml @@ -35,10 +35,10 @@ jobs: echo "Generating SVG from $START_DATE to $END_DATE" # Generate SVG (output to schedule.svg) - npx lts -s "$START_DATE" -e "$END_DATE" -d "$SCHEDULE_JSON" -g "$SCHEDULE_SVG" + npx lts@2.0.0 -s "$START_DATE" -e "$END_DATE" -d "$SCHEDULE_JSON" -g "$SCHEDULE_SVG" # Optimize SVG - npx svgo "$SCHEDULE_SVG" + npx svgo@4.0.0 "$SCHEDULE_SVG" - name: Check for changes in schedule.svg id: git_check