mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-05-11 02:44:20 +00:00
address asset upload warning
This commit is contained in:
parent
ca4bc532b6
commit
4ea9fd8322
3 changed files with 7 additions and 7 deletions
|
@ -15,11 +15,11 @@ describe("github", () => {
|
|||
|
||||
describe("asset", () => {
|
||||
it("derives asset info from a path", async () => {
|
||||
const { name, mime, size, file } = asset("tests/data/foo/bar.txt");
|
||||
const { name, mime, size, data } = asset("tests/data/foo/bar.txt");
|
||||
assert.equal(name, "bar.txt");
|
||||
assert.equal(mime, "text/plain");
|
||||
assert.equal(size, 10);
|
||||
assert.equal(file.toString(), "release me");
|
||||
assert.equal(data.toString(), "release me");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
|
@ -8,7 +8,7 @@ export interface ReleaseAsset {
|
|||
name: string;
|
||||
mime: string;
|
||||
size: number;
|
||||
file: Buffer;
|
||||
data: Buffer;
|
||||
}
|
||||
|
||||
export interface Release {
|
||||
|
@ -116,7 +116,7 @@ export const asset = (path: string): ReleaseAsset => {
|
|||
name: basename(path),
|
||||
mime: mimeOrDefault(path),
|
||||
size: lstatSync(path).size,
|
||||
file: readFileSync(path)
|
||||
data: readFileSync(path)
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -129,7 +129,7 @@ export const upload = async (
|
|||
url: string,
|
||||
path: string
|
||||
): Promise<any> => {
|
||||
let { name, size, mime, file } = asset(path);
|
||||
let { name, size, mime, data } = asset(path);
|
||||
console.log(`⬆️ Uploading ${name}...`);
|
||||
return await gh.repos.uploadReleaseAsset({
|
||||
url,
|
||||
|
@ -138,7 +138,7 @@ export const upload = async (
|
|||
"content-type": mime
|
||||
},
|
||||
name,
|
||||
file
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue