Skip to content

Commit ade5aa7

Browse files
committed
Hotfix: Modify unreadable type of file
Update extension the unreadable sh to js file
1 parent 11b59b4 commit ade5aa7

File tree

3 files changed

+34
-17
lines changed

3 files changed

+34
-17
lines changed

action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ outputs:
3030
description: 'The total time taken to complete the deployment process.'
3131
runs:
3232
using: 'node20'
33-
pre: './pre.sh'
33+
pre: './pre.js'
3434
main: 'dist/index.js'

pre.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import * as child from 'child_process';
2+
3+
const run = (command) => {
4+
return new Promise((resolve, reject) => {
5+
child.exec(command, (error, stdout) => {
6+
if (error) {
7+
reject(error);
8+
return;
9+
}
10+
11+
resolve(stdout);
12+
});
13+
});
14+
};
15+
16+
const main = async () => {
17+
try {
18+
console.log("Starting npm install and build process...");
19+
20+
// Run npm install
21+
await run("npm install");
22+
23+
// Run npm build
24+
await run("npm run build");
25+
26+
console.log("npm install and build completed successfully!");
27+
} catch (error) {
28+
console.error("Process failed:", error);
29+
process.exit(1); // Exit with an error code
30+
}
31+
};
32+
33+
export default main;

pre.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)