From 0eda4e0e09b80e4db7b373bcad95ddc5f20b20e0 Mon Sep 17 00:00:00 2001 From: Lenvin Gonsalves Date: Mon, 25 Jul 2022 18:23:08 +0530 Subject: [PATCH] tools: add skeleton for automate time zone update Fixes: https://github.com/nodejs/node/issues/43134 --- .github/workflows/timezone-update.yml | 29 +++++++++++++++++++++++++++ tools/update-timezone.mjs | 5 +++++ 2 files changed, 34 insertions(+) create mode 100644 .github/workflows/timezone-update.yml create mode 100755 tools/update-timezone.mjs diff --git a/.github/workflows/timezone-update.yml b/.github/workflows/timezone-update.yml new file mode 100644 index 00000000000000..0b0102fe7f90c5 --- /dev/null +++ b/.github/workflows/timezone-update.yml @@ -0,0 +1,29 @@ +name: Timezone update +on: + schedule: + # Run once a week at 00:05 AM UTC on Sunday. + - cron: 5 0 * * 0 + + workflow_dispatch: + +jobs: + authors_update: + if: github.repository == 'nodejs/node' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: '0' # This is required to actually get all the authors + persist-credentials: false + - run: tools/update-timezone.js # Run the timezone tool + - uses: gr2m/create-or-update-pull-request-action@v1 # Create a PR or update the Action's existing PR + env: + GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} + with: + author: Node.js GitHub Bot + body: > + updates the ICU files + branch: actions/timezone-update # Custom branch *just* for this Action. + commit-message: 'meta: update timezone' + labels: meta + title: 'meta: update timezone' \ No newline at end of file diff --git a/tools/update-timezone.mjs b/tools/update-timezone.mjs new file mode 100755 index 00000000000000..6f8c1f9ca9a6cb --- /dev/null +++ b/tools/update-timezone.mjs @@ -0,0 +1,5 @@ +#!/usr/bin/env node +// Usage: tools/update-timezone.mjs [--dry] +// Passing --dry will redirect output to stdout. + +console.log('Initial Skeleton');