Skip to content

Commit 77b6f73

Browse files
anarchivistawilfox
andauthored
Check yarn version and enable corepack (#14)
Without this, we cannot guarantee that we will build galc-ui with the correct version of Yarn. GitHub Actions Ubuntu images ship with [Yarn 1.22.22 by default][0]. [0]: https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md Co-authored-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
1 parent 83a67ef commit 77b6f73

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ jobs:
2323
- name: Check out repository
2424
uses: actions/checkout@v4
2525

26+
# This is required to confirm that GHA will use the right version of Yarn
27+
- name: Enable Corepack
28+
run: corepack enable
29+
30+
- name: Check yarn version
31+
run: |
32+
if [ "`yarn --version`" != "`cat package.json | jq .packageManager -r | cut -c 6-`" ]; then
33+
echo "::warning file=package.json,title=YarnVersionMismatch::Yarn `yarn --version` does not match required version"
34+
else
35+
echo "::notice file=package.json,title=YarnVersionMatch::Yarn `yarn --version` matches required version"
36+
fi
37+
2638
- name: Cache node modules
2739
uses: actions/cache@v4
2840
with:

0 commit comments

Comments
 (0)