Skip to content

Commit 95152f8

Browse files
committed
Address review
1 parent f34cadb commit 95152f8

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

‎.github/workflows/pr-checks.yml‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,16 @@ jobs:
119119
- name: Checkout repository
120120
uses: actions/checkout@v6
121121
with:
122-
depth: 1
122+
fetch-depth: 1
123123

124124
- id: head-version
125125
name: Determine Node version for HEAD
126126
run: |
127+
if [[ ! -f ".nvmrc" ]]; then
128+
echo "::error::Cannot find .nvmrc in the HEAD commit."
129+
exit 1
130+
fi
131+
127132
NODE_VERSION=$(cat .nvmrc)
128133
echo "NODE_VERSION: ${NODE_VERSION}"
129134
echo "node_version=${NODE_VERSION}" >> $GITHUB_OUTPUT
@@ -133,12 +138,17 @@ jobs:
133138
uses: actions/checkout@v6
134139
with:
135140
ref: ${{ env.BASE_REF }}
136-
depth: 1
141+
fetch-depth: 1
137142

138143
- name: 'Backport: Verify Node versions unchanged'
139144
env:
140145
HEAD_VERSION: ${{ steps.head-version.outputs.node_version }}
141146
run: |
147+
if [[ ! -f ".nvmrc" ]]; then
148+
echo "::error::Cannot find .nvmrc in the base commit."
149+
exit 1
150+
fi
151+
142152
BASE_VERSION=$(cat .nvmrc)
143153
echo "HEAD_VERSION: ${HEAD_VERSION}"
144154
echo "BASE_VERSION: ${BASE_VERSION}"

‎build.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const checkNodeVersionsPlugin = {
8383
}
8484

8585
// Write the node version to `.nvmrc`.
86-
writeFile(
86+
await writeFile(
8787
join(__dirname, ".nvmrc"),
8888
nodeVersion.substring("node".length) + "\n",
8989
"utf-8",

0 commit comments

Comments
 (0)