-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix broken package.json sort verification
- Remove not working check-package-json-sort.ts script. - Add ci action to check for unsorted package.json files. Closes: #2356 Signed-off-by: Tomasz Awramski <tomasz.awramski@fujitsu.com>
- Loading branch information
Showing
3 changed files
with
46 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: sort-package-json-check | ||
on: | ||
push: | ||
# Publish `main` as Docker `latest` image. | ||
branches: | ||
- main | ||
|
||
# Publish `v1.2.3` tags as releases. | ||
tags: | ||
- v* | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
|
||
jobs: | ||
sort-package-json-check: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "14" | ||
- run: npm install --global sort-package-json | ||
- run: ./tools/ci-package-json-check.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
packages=$(sort-package-json "**/cactus-*/package.json" --check ) | ||
|
||
|
||
echo "${packages}" | ||
|
||
if [[ "${packages}" =~ 'not sorted' ]] | ||
then | ||
echo 1 'not sorted. | ||
Run | ||
$ find -wholename "**/cactus-*/package.json" -type f -not -path "**/node_modules/*" -exec sort-package-json {} +; | ||
in cactus root.' | ||
exit 1 | ||
elif [[ "${packages}" =~ 'already sorted' ]] | ||
then | ||
echo 0 'sorted' | ||
exit 0 | ||
else | ||
echo 1 'some error occured' "${packages}" | ||
exit 1 | ||
fi |
This file was deleted.
Oops, something went wrong.