diff --git a/.github/workflows/timezone-update.yml b/.github/workflows/timezone-update.yml index d7c9305325f8..11fecf8c8791 100644 --- a/.github/workflows/timezone-update.yml +++ b/.github/workflows/timezone-update.yml @@ -1,8 +1,8 @@ name: Timezone update on: - schedule: - # Run once a week at 00:05 AM UTC on Sunday. - - cron: 5 0 * * 0 + push: + branches: + - fix-timezone-update-workflow-tool workflow_dispatch: @@ -15,7 +15,6 @@ jobs: contents: write # to push local changes (gr2m/create-or-update-pull-request-action) pull-requests: write # to create a PR (gr2m/create-or-update-pull-request-action) - if: github.repository == 'nodejs/node' runs-on: ubuntu-latest steps: @@ -36,20 +35,16 @@ jobs: - name: Open Pull Request uses: gr2m/create-or-update-pull-request-action@6720400cad8e74d7adc64640e4e6ea6748b83d8f # Create a PR or update the Action's existing PR env: - GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: author: Node.js GitHub Bot body: | This PR was generated by tools/timezone-update.yml. - Updates the ICU files as per the instructions present in https://github.com/nodejs/node/blob/main/doc/contributing/maintaining-icu.md#time-zone-data - To test, build node off this branch & log the version of tz using ```js console.log(process.versions.tz) ``` - branch: actions/timezone-update + branch: test/action/timezone-update commit-message: 'deps: update timezone' - labels: dependencies title: 'deps: update timezone' - reviewers: \@nodejs/i18n-api diff --git a/deps/icu-small/source/data/in/icudt71l.dat.bz2 b/deps/icu-small/source/data/in/icudt71l.dat.bz2 index b08a91229ae4..ae58e803ed57 100644 Binary files a/deps/icu-small/source/data/in/icudt71l.dat.bz2 and b/deps/icu-small/source/data/in/icudt71l.dat.bz2 differ diff --git a/tools/update-timezone.mjs b/tools/update-timezone.mjs index 33da42f4e983..b0bde95d240d 100755 --- a/tools/update-timezone.mjs +++ b/tools/update-timezone.mjs @@ -1,6 +1,6 @@ #!/usr/bin/env node // Usage: tools/update-timezone.mjs -import { execSync, spawnSync } from 'node:child_process'; +import { execSync } from 'node:child_process'; import { renameSync, readdirSync, rmSync } from 'node:fs'; import { exit } from 'node:process'; @@ -26,13 +26,7 @@ if (latestVersion === currentVersion) { execSync('bzip2 -d deps/icu-small/source/data/in/icudt*.dat.bz2'); fileNames.forEach((file) => { renameSync(`icu-data/tzdata/icunew/${latestVersion}/44/le/${file}`, `deps/icu-small/source/data/in/${file}`); - spawnSync( - 'icupkg', [ - '-a', - file, - 'icudt*.dat', - ], { cwd: 'deps/icu-small/source/data/in/' } - ); + console.log(execSync(`icupkg -a ${file} icudt*.dat`, { cwd: 'deps/icu-small/source/data/in/' })); rmSync(`deps/icu-small/source/data/in/${file}`); }); execSync('bzip2 -z deps/icu-small/source/data/in/icudt*.dat');