Skip to content

Commit d5f2117

Browse files
authored
Hotfix for v1.0.0 (#3)
* Update: Update action properties - Add runs.pre - Update runs.main * Fix: Build issue - Change how import the child_process * Update: Update vite.config.ts - Change the output file name to 'index.js'
1 parent cd84bae commit d5f2117

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

action.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ outputs:
2121
description: 'The total time taken to complete the deployment process.'
2222
runs:
2323
using: 'node20'
24-
main: 'dist/main'
24+
pre: 'npm build'
25+
main: 'dist/index.js'

src/utils/Slack.util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { exec } from "child_process";
1+
import * as child from "child_process";
22

33
export class Slack {
44
webhookUrl: string;
@@ -9,7 +9,7 @@ export class Slack {
99

1010
send(payload: string) {
1111
return new Promise((resolve, reject) => {
12-
exec(
12+
child.exec(
1313
`curl -X POST -H 'Content-type: application/json' --data '${payload}'`,
1414
(error, stdout) => {
1515
if (error) {

src/utils/Vercel.util.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { exec } from 'child_process';
1+
import * as child from 'child_process';
22

33
export class Vercel {
44
token: string;
@@ -9,7 +9,7 @@ export class Vercel {
99

1010
pull() {
1111
return new Promise((resolve, reject) => {
12-
exec(
12+
child.exec(
1313
`npx vercel build --token=${this.token} --yes`,
1414
(error, stdout) => {
1515
if (error) {
@@ -25,7 +25,7 @@ export class Vercel {
2525

2626
build() {
2727
return new Promise((resolve, reject) => {
28-
exec(
28+
child.exec(
2929
`npx vercel build --token=${this.token}`,
3030
(error, stdout) => {
3131
if (error) {
@@ -41,7 +41,7 @@ export class Vercel {
4141

4242
deploy() {
4343
return new Promise((resolve, reject) => {
44-
exec(
44+
child.exec(
4545
`npx vercel --token=${this.token} --prod`,
4646
(error, stdout) => {
4747
if (error) {

vite.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,12 @@ export default defineConfig({
1111
name: 'VercelDeployWithSlack',
1212
fileName: 'vercel-deploy-with-slack'
1313
},
14+
outDir: 'dist',
15+
rollupOptions: {
16+
treeshake: true,
17+
output: {
18+
entryFileNames: 'index.js',
19+
},
20+
},
1421
},
1522
});

0 commit comments

Comments
 (0)