File tree 2 files changed +25
-2
lines changed
2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 32
32
"lint" : " npx eslint . -c ./.github/linters/.eslintrc.yml" ,
33
33
"package" : " npx ncc build src/index.ts -o dist --source-map --license licenses.txt" ,
34
34
"package:watch" : " npm run package -- --watch" ,
35
- "package:watch:local" : " npx ncc build src/index.ts -o .local/dist --source-map --license licenses.txt" ,
36
- "dev" : " npm run package:watch:local && OPENAPI_DIFF_NODE_ENV=local node ./.local/dist/index.js" ,
35
+ "package:local" : " npx ncc build src/index.ts -o .local/dist --source-map --license licenses.txt" ,
36
+ "package:watch:local" : " npm run package:local -- --watch" ,
37
+ "dev" : " npm run package:watch:local && npm run dev:nodemon" ,
38
+ "dev:nodemon" : " OPENAPI_DIFF_NODE_ENV=local nodemon ./.local/dist/index.js --watch ./.local/dist/index.js" ,
37
39
"test" : " npx jest" ,
38
40
"all" : " npm run format:write && npm run lint && npm run test && npm run coverage && npm run package"
39
41
},
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { stdout } from 'process'
4
4
import { getFileFromBranch } from './utils/get-file-from-branch'
5
5
import { diffOpenapiObject } from './utils/diff-openapi-object'
6
6
import fs from 'fs'
7
+ import * as http from 'http'
7
8
/**
8
9
* The main function for the action.
9
10
* @returns {Promise<void> } Resolves when the action is complete.
@@ -79,6 +80,26 @@ export async function run(): Promise<void> {
79
80
if ( ! isLocal ) {
80
81
core . setOutput ( 'result' , result )
81
82
}
83
+
84
+ if ( isLocal ) {
85
+ // Define the port number
86
+ const PORT = 5050
87
+
88
+ // Create a server
89
+ const server : http . Server = http . createServer ( ( req , res ) => {
90
+ // Set the response header
91
+ res . writeHead ( 200 , { 'Content-Type' : 'text/html; charset=utf-8' } )
92
+
93
+ // send reponse with result
94
+ res . end ( result ) //sds
95
+ res . end ( 'dd' )
96
+ } )
97
+
98
+ // Start the server
99
+ server . listen ( PORT , ( ) => {
100
+ console . log ( `Server is running on port ${ PORT } ` )
101
+ } )
102
+ }
82
103
} catch ( error ) {
83
104
// Fail the workflow run if an error occurs
84
105
if ( error instanceof Error ) core . setFailed ( error . message )
You can’t perform that action at this time.
0 commit comments