mirror of
https://github.com/github/codeql-action.git
synced 2026-08-05 04:57:19 -05:00
Address review
This commit is contained in:
@@ -119,11 +119,16 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
depth: 1
|
fetch-depth: 1
|
||||||
|
|
||||||
- id: head-version
|
- id: head-version
|
||||||
name: Determine Node version for HEAD
|
name: Determine Node version for HEAD
|
||||||
run: |
|
run: |
|
||||||
|
if [[ ! -f ".nvmrc" ]]; then
|
||||||
|
echo "::error::Cannot find .nvmrc in the HEAD commit."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
NODE_VERSION=$(cat .nvmrc)
|
NODE_VERSION=$(cat .nvmrc)
|
||||||
echo "NODE_VERSION: ${NODE_VERSION}"
|
echo "NODE_VERSION: ${NODE_VERSION}"
|
||||||
echo "node_version=${NODE_VERSION}" >> $GITHUB_OUTPUT
|
echo "node_version=${NODE_VERSION}" >> $GITHUB_OUTPUT
|
||||||
@@ -133,12 +138,17 @@ jobs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: ${{ env.BASE_REF }}
|
ref: ${{ env.BASE_REF }}
|
||||||
depth: 1
|
fetch-depth: 1
|
||||||
|
|
||||||
- name: 'Backport: Verify Node versions unchanged'
|
- name: 'Backport: Verify Node versions unchanged'
|
||||||
env:
|
env:
|
||||||
HEAD_VERSION: ${{ steps.head-version.outputs.node_version }}
|
HEAD_VERSION: ${{ steps.head-version.outputs.node_version }}
|
||||||
run: |
|
run: |
|
||||||
|
if [[ ! -f ".nvmrc" ]]; then
|
||||||
|
echo "::error::Cannot find .nvmrc in the base commit."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
BASE_VERSION=$(cat .nvmrc)
|
BASE_VERSION=$(cat .nvmrc)
|
||||||
echo "HEAD_VERSION: ${HEAD_VERSION}"
|
echo "HEAD_VERSION: ${HEAD_VERSION}"
|
||||||
echo "BASE_VERSION: ${BASE_VERSION}"
|
echo "BASE_VERSION: ${BASE_VERSION}"
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ const checkNodeVersionsPlugin = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Write the node version to `.nvmrc`.
|
// Write the node version to `.nvmrc`.
|
||||||
writeFile(
|
await writeFile(
|
||||||
join(__dirname, ".nvmrc"),
|
join(__dirname, ".nvmrc"),
|
||||||
nodeVersion.substring("node".length) + "\n",
|
nodeVersion.substring("node".length) + "\n",
|
||||||
"utf-8",
|
"utf-8",
|
||||||
|
|||||||
Reference in New Issue
Block a user