Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript (v3): Add package validation script. #6167

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

4 changes: 2 additions & 2 deletions javascriptv3/example_code/bedrock-agent-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bedrock-agent-runtime-examples",
"name": "@aws-doc-sdk-examples/bedrock-agent-runtime-examples",
"version": "1.0.0",
"author": "Dinuda Yaggahavita <[email protected]>",
"author": "Dinuda Yaggahavita <[email protected]>, Corey Pyle <[email protected]>",
"license": "Apache-2.0",
"type": "module",
"scripts": {
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
Loading