Skip to content

Commit 3673fd3

Browse files
committed
Add pnpm support
1 parent 2b0d1b2 commit 3673fd3

2 files changed

Lines changed: 24 additions & 9 deletions

File tree

.github/workflows/i18n_check.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Runs `yarn i18n` and asserts that it made no further changes
1+
# Runs `yarn/pnpm i18n` and asserts that it made no further changes
22
# Additionally prevents changes to files other than en_EN.json apart from RiotRobot automations
33
name: i18n Check
44
on:
@@ -17,11 +17,18 @@ on:
1717
required: false
1818
description: "Path to root of project to check"
1919
default: "."
20+
packageManager:
21+
type: string
22+
required: false
23+
default: "yarn"
24+
description: "Which of 'yarn' or 'pnpm' to use."
2025
jobs:
2126
check:
2227
runs-on: ubuntu-latest
2328
permissions:
2429
pull-requests: read
30+
env:
31+
PM: ${{ inputs.packageManager }}
2532
steps:
2633
- uses: actions/checkout@v3
2734

@@ -40,24 +47,24 @@ jobs:
4047
if: steps.changed_files.outputs.any_modified == 'true'
4148
run: |
4249
exit 1
43-
echo "Only translation files modified by 'yarn i18n' can be committed - other translation files will confuse weblate in unrecoverable ways."
50+
echo "Only translation files modified by '$PM i18n' can be committed - other translation files will confuse weblate in unrecoverable ways."
4451
4552
- run: corepack enable
4653
- uses: actions/setup-node@v4
4754
with:
48-
cache: "yarn"
55+
cache: ${{ inputs.packageManager }}
4956
node-version-file: package.json
5057

5158
# Does not need branch matching as only analyses this layer
5259
- name: Install Deps
5360
working-directory: ${{ inputs.path }}
54-
run: "yarn install --frozen-lockfile"
61+
run: "$PM install --frozen-lockfile"
5562

5663
- name: "Run i18n"
5764
working-directory: ${{ inputs.path }}
5865
env:
5966
HARDCODED_WORDS: ${{ inputs.hardcoded-words }}
6067
ALLOWED_HARDCODED_KEYS: ${{ inputs.allowed-hardcoded-keys }}
61-
run: yarn run i18n
68+
run: $PM run i18n
6269

6370
- run: git diff --exit-code

.github/workflows/localazy_download.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,31 @@
22
name: Localazy Download
33
on:
44
workflow_call:
5+
inputs:
6+
packageManager:
7+
type: string
8+
required: false
9+
default: "yarn"
10+
description: "Which of 'yarn' or 'pnpm' to use."
511
secrets:
612
ELEMENT_BOT_TOKEN:
713
required: true
814
jobs:
915
download:
1016
runs-on: ubuntu-latest
17+
env:
18+
PM: ${{ inputs.packageManager }}
1119
steps:
1220
- uses: actions/checkout@v3
1321

1422
- run: corepack enable
1523
- uses: actions/setup-node@v3
1624
with:
17-
cache: "yarn"
25+
cache: ${{ inputs.packageManager }}
1826
node-version-file: package.json
1927

2028
- name: Install Deps
21-
run: "yarn install --frozen-lockfile"
29+
run: "$PM install --frozen-lockfile"
2230

2331
- name: Prune i18n
2432
run: "rm -R src/i18n/strings/*.json"
@@ -29,8 +37,8 @@ jobs:
2937

3038
- run: "sudo chown runner:docker src/i18n/strings/*.json"
3139

32-
- run: "yarn i18n:sort"
33-
- run: "yarn i18n:lint"
40+
- run: "$PM i18n:sort"
41+
- run: "$PM i18n:lint"
3442

3543
- name: Check modified files
3644
id: changed_files

0 commit comments

Comments
 (0)