Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
tools: add skeleton for automate time zone update
Fixes: #43134
  • Loading branch information
98lenvi committed Aug 9, 2022
commit 564e813260ee7c9409b46e5961ba8b0c2067bfa3
29 changes: 29 additions & 0 deletions .github/workflows/timezone-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Timezone update
on:
schedule:
# Run once a week at 00:05 AM UTC on Sunday.
- cron: 5 0 * * 0
Comment on lines +3 to +5
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these releases are so infrequent, max 5 times a year. Probably better to just run on workflow dispatch.

If you do want to check weekly, it might be better to use caching and cache the icu-data checkout, and then do an update. Maybe there's some other way to trigger this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @srl295. I'm a bit confused about the caching. Every time we run this we want to ensure that we are fetching the latest data from ICU upstream & then find if we have something new in the repo.
I'll just change it to workflow dispatch/manually trigerred.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's manually, we might miss the updates & only know when someone reports that a new version is out. The goal of this PR was to have the workflow tell us that a new version is out.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having it run weekly is OK if we don't have any other way to trigger it when there's actually an update.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I meant is if the repository was cached it wouldn't have to redownload every time.

@yumaoka are updates always mentioned on icu-announce? If so then subscribers to that wouldn't miss it.


workflow_dispatch:

jobs:
authors_update:
Comment thread
aduh95 marked this conversation as resolved.
Outdated
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
Comment thread
aduh95 marked this conversation as resolved.
Outdated
persist-credentials: false
- run: tools/update-timezone.js # Run the timezone tool
Comment thread
aduh95 marked this conversation as resolved.
Outdated
- uses: gr2m/create-or-update-pull-request-action@v1 # Create a PR or update the Action's existing PR
Comment thread
aduh95 marked this conversation as resolved.
Outdated
env:
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
with:
author: Node.js GitHub Bot <github-bot@iojs.org>
body: >
updates the ICU files
Comment thread
aduh95 marked this conversation as resolved.
Outdated
branch: actions/timezone-update # Custom branch *just* for this Action.
commit-message: 'meta: update timezone'
Comment thread
aduh95 marked this conversation as resolved.
Outdated
labels: meta
title: 'meta: update timezone'
Comment thread
aduh95 marked this conversation as resolved.
Outdated
5 changes: 5 additions & 0 deletions tools/update-timezone.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env node
// Usage: tools/update-timezone.mjs [--dry]
// Passing --dry will redirect output to stdout.
Comment thread
98lenvi marked this conversation as resolved.
Outdated

console.log('Initial Skeleton');