Skip to content

Commit

Permalink
JavaScript (v3): Add package validation script.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpyle0819 committed Feb 23, 2024
1 parent 365bd81 commit 9577e9e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ jobs:
changed_files=(${{steps.changed-files.outputs.all_changed_files}})
npm run --prefix javascriptv3 ci-lint -- ${changed_files[@]//javascriptv3\/}
name: Lint added and modified files
- run: ./javascriptv3/github_scripts/validate_packages.sh
name: Validate package names

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "bedrock-agent-runtime-examples",
"name": "@aws-doc-sdk-examples/bedrock-agent-runtime-examples",
"version": "1.0.0",
"author": "Dinuda Yaggahavita <[email protected]>",
"license": "Apache-2.0",
Expand Down
14 changes: 14 additions & 0 deletions javascriptv3/github_scripts/validate_packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -e
errors_found=false
packages=$(npm query --prefix javascriptv3 .workspace | jq -r '.[].name')
for package_name in $packages; do
if [[ "$package_name" != *"@aws-doc-sdk-examples/"* ]]; then
echo "Error: Prefix '@aws-doc-sdk-examples/' is missing in package '$package_name'"
errors_found=true
fi
done

if [ "$errors_found" = true ]; then
exit 1
fi

0 comments on commit 9577e9e

Please sign in to comment.