File tree Expand file tree Collapse file tree 7 files changed +1329
-0
lines changed Expand file tree Collapse file tree 7 files changed +1329
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+ name : Publish Node Fetch Session Package
3
+
4
+ on :
5
+ release :
6
+ types : [published]
7
+
8
+ jobs :
9
+ build :
10
+ if : startsWith(github.ref, 'refs/tags/prod-')
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - uses : actions/checkout@v2
14
+ - uses : actions/setup-node@v2
15
+ with :
16
+ node-version : 14
17
+ - run : npm install
18
+
19
+ publish-npm :
20
+ needs : build
21
+ runs-on : ubuntu-latest
22
+ steps :
23
+ - uses : actions/checkout@v2
24
+ - uses : actions/setup-node@v2
25
+ with :
26
+ node-version : 14
27
+ registry-url : https://registry.npmjs.org/
28
+ - run : npm install
29
+ - run : npm publish --access public
30
+ env :
31
+ NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
Original file line number Diff line number Diff line change
1
+ # Dependency directories
2
+ . /node_modules
Original file line number Diff line number Diff line change
1
+ /node_modules /
2
+ * .DS_Store
3
+ * .log
4
+ /.vscode /
5
+ /.github /
Original file line number Diff line number Diff line change
1
+ <!-- add Readme Here -->
Original file line number Diff line number Diff line change
1
+ const ltClient = require ( "@lambdatest/node-rest-client" ) ;
2
+ module . exports . fetchSession = async ( options ) => {
3
+ // read credentials from env
4
+
5
+ if ( ! process . env . LT_ACCESS_KEY || ! process . env . LT_USERNAME ) {
6
+ console . log ( "Access and username is required" )
7
+ throw new Error ( "User name and Access is required parameter" )
8
+ }
9
+
10
+ // read build name from env
11
+ if ( ! process . env . LT_BUILD ) {
12
+ console . log ( " Please set Build name to env" )
13
+ throw new Error ( "Build name is required" )
14
+ }
15
+
16
+ const autoClient = ltClient . AutomationClient ( {
17
+ username : process . env . LT_USERNAME ,
18
+ accessKey : process . env . LT_ACCESS_KEY ,
19
+ } ) ;
20
+
21
+ if ( ! options ) {
22
+ // using default options
23
+ console . log ( "Setting default configurations" )
24
+ options = {
25
+ buildLimt : 20 ,
26
+ buildName : process . env . LT_BUILD ,
27
+ sessionParams : {
28
+ limit : 10000 ,
29
+ } ,
30
+ }
31
+ }
32
+ const data = await autoClient . getSessionsOfBuild ( options ) ;
33
+ console . log ( JSON . stringify ( data ) ) ;
34
+ return
35
+
36
+ }
You can’t perform that action at this time.
0 commit comments