fix(ci): verify deployed version from package.json
This commit is contained in:
parent
8aaae6a8db
commit
f0ffa62f52
7
.github/workflows/deploy.yml
vendored
7
.github/workflows/deploy.yml
vendored
@ -228,8 +228,11 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Verify the installed version matches the requested version.
|
# Verify the installed version matches the requested version.
|
||||||
INSTALLED="$(npm ls -g "${PLUGIN_NAME}" --depth=0 2>/dev/null \
|
GLOBAL_ROOT="$(npm root -g)"
|
||||||
| awk -F'[@:]' '/'"${PLUGIN_NAME}"'@/ {print $2; exit}' || true)"
|
INSTALLED=""
|
||||||
|
if [ -f "${GLOBAL_ROOT}/${PLUGIN_NAME}/package.json" ]; then
|
||||||
|
INSTALLED="$(node -p "require('${GLOBAL_ROOT}/${PLUGIN_NAME}/package.json').version")"
|
||||||
|
fi
|
||||||
if [ "${INSTALLED}" != "${VERSION}" ]; then
|
if [ "${INSTALLED}" != "${VERSION}" ]; then
|
||||||
echo "::remote-error::Verification failed: expected ${VERSION}, found ${INSTALLED:-<none>}"
|
echo "::remote-error::Verification failed: expected ${VERSION}, found ${INSTALLED:-<none>}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user