-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
74 lines (60 loc) · 2.76 KB
/
timezone-update.yml
File metadata and controls
74 lines (60 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Timezone update
on:
schedule:
# Run once a week at 00:05 AM UTC on Sunday.
- cron: 5 0 * * 0
workflow_dispatch:
permissions:
contents: read
jobs:
timezone_update:
permissions:
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'
# cannot use ubuntu-slim here because it does not have icupkg
runs-on: ubuntu-latest
steps:
- name: Checkout nodejs/node
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Checkout unicode-org/icu-data
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: icu-data
persist-credentials: false
repository: unicode-org/icu-data
- name: Record new version
run: echo "new_version=$(ls icu-data/tzdata/icunew | tail -1)" >> $GITHUB_ENV
- name: Record current version
run: echo "current_version=$(cat ./test/fixtures/tz-version.txt)" >> $GITHUB_ENV
- name: Compare versions
run: |
echo "Comparing current version ${{ env.current_version }} to new version ${{ env.new_version }}"
- run: ./tools/dep_updaters/update-timezone.mjs
if: ${{ env.new_version != env.current_version }}
- name: Update the expected timezone version in test
if: ${{ env.new_version != env.current_version }}
run: echo "${{ env.new_version }}" > test/fixtures/tz-version.txt
- name: Open Pull Request
if: ${{ env.new_version != env.current_version }}
# Create a PR or update the Action's existing PR
uses: gr2m/create-or-update-pull-request-action@b65137ca591da0b9f43bad7b24df13050ea45d1b # v1.10.1
env:
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
with:
author: Node.js GitHub Bot <[email protected]>
body: |
This PR was generated by `.github/workflows/timezone-update.yml` and `tools/dep_updaters/update-timezone.mjs`.
Updates the ICU files as per the instructions present in https://github.com/nodejs/node/blob/main/doc/contributing/maintaining/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
commit-message: 'deps: update timezone to ${{ env.new_version }}'
labels: dependencies
title: 'deps: update timezone to ${{ env.new_version }}'
reviewers: \@nodejs/i18n-api
update-pull-request-title-and-body: true