File tree Expand file tree Collapse file tree 7 files changed +72
-217
lines changed Expand file tree Collapse file tree 7 files changed +72
-217
lines changed Original file line number Diff line number Diff line change 98
98
- name : Setup NPM authentication
99
99
run : |
100
100
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
102
103
103
104
- name : Determine version and package name
104
105
id : version
@@ -117,10 +118,11 @@ jobs:
117
118
118
119
- name : Publish to npm
119
120
run : |
121
+ PACKAGE_FILE=$(ls aws-lambda-ric-*.tgz)
120
122
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
122
124
else
123
- npm publish aws-lambda-ric-*.tgz
125
+ npm publish $PACKAGE_FILE --access=public
124
126
fi
125
127
126
128
- name : Create GitHub Release
Original file line number Diff line number Diff line change 20
20
"format" : " npm run format:src && npm run format:test" ,
21
21
"format:src" : " prettier --check \" src/*.*js\" --write" ,
22
22
"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 " ,
25
25
"lint" : " eslint --ext \" .js\" src test && npm run check-headers" ,
26
26
27
27
"fix" : " eslint --fix --ext \" .js\" src test" ,
68
68
"eslint" : " 8.42.0" ,
69
69
"eslint-config-prettier" : " 8.8.0" ,
70
70
"eslint-plugin-prettier" : " 4.2.1" ,
71
- "glob" : " ^10.3.10 " ,
71
+
72
72
"husky" : " ^8.0.3" ,
73
73
"lambda-runtime" : " file:./src/" ,
74
74
"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."
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const { execSync } = require('child_process');
12
12
describe ( 'check-headers script' , function ( ) {
13
13
it ( 'should detect files with proper headers' , function ( ) {
14
14
// This test file itself has the proper header
15
- const result = execSync ( 'node ./scripts/check-headers.js ' , {
15
+ const result = execSync ( './scripts/check-headers.sh ' , {
16
16
env : { ...process . env , NODE_ENV : 'test' } ,
17
17
stdio : 'pipe'
18
18
} ) . toString ( ) ;
You can’t perform that action at this time.
0 commit comments