From 53d2d7f91694aafb24aef7def4ad65b91c917b28 Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Wed, 3 Aug 2022 15:55:23 -0500 Subject: [PATCH] add auto-update resolutions script (#564) Co-authored-by: Segment Github --- package.json | 2 +- scripts/update-lockfile.sh | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 scripts/update-lockfile.sh diff --git a/package.json b/package.json index 5f038bf0d..283bc07e6 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "dev": "yarn workspace with-next-js run dev", "postinstall": "husky install", "changeset": "changeset", - "update-versions-and-changelogs": "changeset version && yarn version-run-all", + "update-versions-and-changelogs": "changeset version && yarn version-run-all && bash scripts/update-lockfile.sh", "release": "yarn build:packages --force && changeset publish && yarn postpublish-run-all && git push origin --tags --no-verify", "postpublish-run-all": "yarn workspaces foreach -vpt --no-private run postpublish", "version-run-all": "yarn workspaces foreach -vpt --no-private run version", diff --git a/scripts/update-lockfile.sh b/scripts/update-lockfile.sh new file mode 100644 index 000000000..d47c6c6a5 --- /dev/null +++ b/scripts/update-lockfile.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Changesets does not support yarn, so if the resolutions change, we want to commit them as part of the version pipeline. +echo "Checking if yarn.lock is up-to-date" +yarn install +if [[ -n $(git status --porcelain | grep yarn.lock) ]]; then + echo "Adding yarn.lock..." + git add yarn.lock + # The yarn.lock will be auto-commited by the changeset github action +else + echo "No yarn.lock updates needed" +fi