mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-06-27 22:06:03 +00:00
chore: replace mime
with mime-types
(#624)
Some checks are pending
main / build (push) Waiting to run
Some checks are pending
main / build (push) Waiting to run
Signed-off-by: Rui Chen <rui@chenrui.dev>
This commit is contained in:
parent
86463358d8
commit
8836085300
4 changed files with 42 additions and 20 deletions
19
dist/index.js
vendored
19
dist/index.js
vendored
File diff suppressed because one or more lines are too long
35
package-lock.json
generated
35
package-lock.json
generated
|
@ -13,12 +13,12 @@
|
|||
"@octokit/plugin-retry": "^8.0.1",
|
||||
"@octokit/plugin-throttling": "^11.0.1",
|
||||
"glob": "^11.0.2",
|
||||
"mime": "^3.0.0"
|
||||
"mime-types": "^3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/glob": "^8.1.0",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/mime": "^3.0.1",
|
||||
"@types/mime-types": "^3.0.1",
|
||||
"@types/node": "^22.15.21",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"jest": "^29.3.1",
|
||||
|
@ -1721,10 +1721,10 @@
|
|||
"pretty-format": "^29.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/mime": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.4.tgz",
|
||||
"integrity": "sha512-iJt33IQnVRkqeqC7PzBHPTC6fDlRNRW8vjrgqtScAhrmMwe8c4Eo7+fUGTa+XdWrpEgpyKWMYmi2dIwMAYRzPw==",
|
||||
"node_modules/@types/mime-types": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/mime-types/-/mime-types-3.0.1.tgz",
|
||||
"integrity": "sha512-xRMsfuQbnRq1Ef+C+RKaENOxXX87Ygl38W1vDfPHRku02TgQr+Qd8iivLtAMcR0KF5/29xlnFihkTlbqFrGOVQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
|
@ -3808,16 +3808,25 @@
|
|||
"node": ">=8.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz",
|
||||
"integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==",
|
||||
"node_modules/mime-db": {
|
||||
"version": "1.54.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",
|
||||
"integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"mime": "cli.js"
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-types": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz",
|
||||
"integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mime-db": "^1.54.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mimic-fn": {
|
||||
|
|
|
@ -26,12 +26,12 @@
|
|||
"@octokit/plugin-retry": "^8.0.1",
|
||||
"@octokit/plugin-throttling": "^11.0.1",
|
||||
"glob": "^11.0.2",
|
||||
"mime": "^3.0.0"
|
||||
"mime-types": "^3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/glob": "^8.1.0",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/mime": "^3.0.1",
|
||||
"@types/mime-types": "^3.0.1",
|
||||
"@types/node": "^22.15.21",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"jest": "^29.3.1",
|
||||
|
|
|
@ -2,7 +2,7 @@ import { GitHub } from "@actions/github/lib/utils";
|
|||
import { Config, isTag, releaseBody, alignAssetName } from "./util";
|
||||
import { statSync } from "fs";
|
||||
import { open } from "fs/promises";
|
||||
import { getType } from "mime";
|
||||
import { lookup } from "mime-types";
|
||||
import { basename } from "path";
|
||||
|
||||
type GitHub = InstanceType<typeof GitHub>;
|
||||
|
@ -149,7 +149,7 @@ export const asset = (path: string): ReleaseAsset => {
|
|||
};
|
||||
|
||||
export const mimeOrDefault = (path: string): string => {
|
||||
return getType(path) || "application/octet-stream";
|
||||
return lookup(path) || "application/octet-stream";
|
||||
};
|
||||
|
||||
export const upload = async (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue