File tree Expand file tree Collapse file tree 7 files changed +71
-238
lines changed Expand file tree Collapse file tree 7 files changed +71
-238
lines changed Original file line number Diff line number Diff line change 9898 - name : Setup NPM authentication
9999 run : |
100100 NPM_TOKEN=$(aws secretsmanager get-secret-value --secret-id aws-lambda-runtimes/github/nodejs/npm-token --query SecretString --output text)
101- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
101+ echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
102+ chmod 0600 .npmrc
102103
103104 - name : Determine version and package name
104105 id : version
@@ -117,10 +118,11 @@ jobs:
117118
118119 - name : Publish to npm
119120 run : |
121+ PACKAGE_FILE=$(ls aws-lambda-ric-*.tgz)
120122 if [[ "${{ steps.version.outputs.is_rc }}" == "true" ]]; then
121- npm publish aws-lambda-ric-*.tgz --tag rc
123+ npm publish $PACKAGE_FILE --tag rc --access=public
122124 else
123- npm publish aws-lambda-ric-*.tgz
125+ npm publish $PACKAGE_FILE --access=public
124126 fi
125127
126128 - name : Create GitHub Release
Original file line number Diff line number Diff line change 2020 "format" : " npm run format:src && npm run format:test" ,
2121 "format:src" : " prettier --check \" src/*.*js\" --write" ,
2222 "format:test" : " prettier --check \" test/**/*.*js\" --write" ,
23- "check-headers" : " node ./scripts/check-headers.js " ,
24- "add-headers" : " node ./scripts/add-headers.js " ,
23+ "check-headers" : " ./scripts/check-headers.sh " ,
24+ "add-headers" : " ./scripts/add-headers.sh " ,
2525 "lint" : " eslint --ext \" .js\" src test && npm run check-headers" ,
2626
2727 "fix" : " eslint --fix --ext \" .js\" src test" ,
6868 "eslint" : " 8.42.0" ,
6969 "eslint-config-prettier" : " 8.8.0" ,
7070 "eslint-plugin-prettier" : " 4.2.1" ,
71- "glob" : " ^10.3.10 " ,
71+
7272 "husky" : " ^8.0.3" ,
7373 "lambda-runtime" : " file:./src/" ,
7474 "mocha" : " ^10.8.2" ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+ # SPDX-License-Identifier: Apache-2.0
4+
5+ set -e
6+
7+ # Find files missing copyright headers
8+ files=$( git ls-files ' bin/**' ' scripts/**' ' src/**' ' test/**' | \
9+ grep -E ' \.(js|ts|mjs|mts|jsx|tsx|c|cpp|h)$' | \
10+ xargs grep -L ' Copyright.*Amazon\.com' || true)
11+
12+ if [ -z " $files " ]; then
13+ echo " ✓ All files already have copyright headers"
14+ exit 0
15+ fi
16+
17+ echo " Found $( echo " $files " | wc -l) files missing headers"
18+
19+ # Add headers
20+ for file in $files ; do
21+ if [[ " $file " == * .sh ]]; then
22+ header=" #!/bin/bash
23+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
24+ # SPDX-License-Identifier: Apache-2.0
25+
26+ "
27+ else
28+ header=" /*
29+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
30+ SPDX-License-Identifier: Apache-2.0
31+ */
32+
33+ "
34+ fi
35+
36+ echo " $header $( cat " $file " ) " > " $file "
37+ echo " ✓ Added header to $file "
38+ done
39+
40+ echo
41+ echo " ✓ All copyright headers added successfully"
42+ echo " Run 'git diff' to review changes before committing"
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+ # SPDX-License-Identifier: Apache-2.0
4+
5+ set -e
6+
7+ # Find files missing copyright headers
8+ files=$( git ls-files ' bin/**' ' scripts/**' ' src/**' ' test/**' | \
9+ grep -E ' \.(js|ts|mjs|mts|jsx|tsx|c|cpp|h|sh)$' | \
10+ xargs grep -L ' Copyright.*Amazon\.com' || true)
11+
12+ if [ -n " $files " ]; then
13+ echo " ❌ Copyright header check failed."
14+ echo " Files missing required \" Copyright\" and \" Amazon.com\" keywords:"
15+ echo " $files " | sed ' s/^/ - /'
16+ echo
17+ echo " Run 'npm run add-headers' to fix these issues."
18+ exit 1
19+ fi
20+
21+ echo " ✅ All files have proper copyright headers."
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments