mirror of
https://github.com/tsickert/discord-webhook.git
synced 2025-02-03 13:16:40 -05:00
Try new build with fixes
This commit is contained in:
parent
4c21ae0a2d
commit
8053f289df
7 changed files with 17 additions and 27 deletions
|
@ -12,6 +12,7 @@
|
|||
"eslint-comments/no-use": "off",
|
||||
"import/no-namespace": "off",
|
||||
"no-unused-vars": "off",
|
||||
"sort-imports": "off",
|
||||
"@typescript-eslint/no-unused-vars": "error",
|
||||
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
|
||||
"@typescript-eslint/no-require-imports": "error",
|
||||
|
@ -52,4 +53,4 @@
|
|||
"es6": true,
|
||||
"jest/globals": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
BIN
dist/index.js
generated
vendored
BIN
dist/index.js
generated
vendored
Binary file not shown.
BIN
dist/index.js.map
generated
vendored
BIN
dist/index.js.map
generated
vendored
Binary file not shown.
BIN
dist/licenses.txt
generated
vendored
BIN
dist/licenses.txt
generated
vendored
Binary file not shown.
11
package-lock.json
generated
11
package-lock.json
generated
|
@ -15,6 +15,7 @@
|
|||
"form-data": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/axios": "^0.14.0",
|
||||
"@types/jest": "^27.5.2",
|
||||
"@types/node": "^18.7.8",
|
||||
"@typescript-eslint/eslint-plugin": "^5.33.1",
|
||||
|
@ -2063,6 +2064,16 @@
|
|||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/axios": {
|
||||
"version": "0.14.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/axios/-/axios-0.14.0.tgz",
|
||||
"integrity": "sha512-KqQnQbdYE54D7oa/UmYVMZKq7CO4l8DEENzOKc4aBRwxCXSlJXGz83flFx5L7AWrOQnmuN3kVsRdt+GZPPjiVQ==",
|
||||
"deprecated": "This is a stub types definition for axios (https://github.com/mzabriskie/axios). axios provides its own type definitions, so you don't need @types/axios installed!",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"axios": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/babel__core": {
|
||||
"version": "7.1.16",
|
||||
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.16.tgz",
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
"main": "lib/webhook.js",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"format": "prettier --write '**/*.ts'",
|
||||
"format-check": "prettier --check '**/*.ts'",
|
||||
"format": "prettier --write src/**/*.ts",
|
||||
"format-check": "prettier --check src/**/*.ts",
|
||||
"lint": "eslint src/**/*.ts",
|
||||
"package": "ncc build --source-map --license licenses.txt",
|
||||
"test": "jest",
|
||||
|
@ -31,6 +31,7 @@
|
|||
"form-data": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/axios": "^0.14.0",
|
||||
"@types/jest": "^27.5.2",
|
||||
"@types/node": "^18.7.8",
|
||||
"@typescript-eslint/eslint-plugin": "^5.33.1",
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import * as core from '@actions/core'
|
||||
import {createReadStream, readFileSync} from 'fs'
|
||||
import axios from 'axios'
|
||||
import {HttpClient} from '@actions/http-client'
|
||||
import {TypedResponse} from '@actions/http-client/lib/interfaces'
|
||||
import {blob} from 'node:stream/consumers'
|
||||
import axios from 'axios'
|
||||
|
||||
const WEBHOOK_URL = 'webhook-url'
|
||||
const CONTENT = 'content'
|
||||
|
@ -179,29 +179,6 @@ export async function executeWebhook(): Promise<void> {
|
|||
`successfully uploaded file with status code: ${response.status}`
|
||||
)
|
||||
}
|
||||
|
||||
// request
|
||||
// .on('response', response => {
|
||||
// if (response.statusCode !== 200) {
|
||||
// if (filename !== '') {
|
||||
// core.error(`failed to upload file: ${response.statusMessage}`)
|
||||
// }
|
||||
// if (threadName !== '') {
|
||||
// core.error(`failed to create thread: ${threadName}`)
|
||||
// }
|
||||
// } else if (filename !== '') {
|
||||
// core.info(
|
||||
// `successfully uploaded file with status code: ${response.statusCode}`
|
||||
// )
|
||||
// }
|
||||
// if (fileStream != null) {
|
||||
// fileStream.destroy()
|
||||
// }
|
||||
// response.destroy()
|
||||
// })
|
||||
// .on('error', err => {
|
||||
// core.error(err.message)
|
||||
// })
|
||||
} else {
|
||||
const response = await client.postJson(webhookUrl, payload)
|
||||
await handleResponse(response)
|
||||
|
|
Loading…
Reference in a new issue