MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / uploadAssets

Function uploadAssets

scripts/release-helper.mjs:82–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80}
81
82export async function uploadAssets() {
83 const release = await ensureRelease();
84 let assets = await readdir(ASSETS_DIR);
85 assets = assets.filter((asset) =>
86 release.assets.every(({ name }) => name !== asset),
87 );
88 for (const asset of assets) {
89 console.info(`> Upload asset: ${asset}`);
90 await getOctokit().rest.repos.uploadReleaseAsset({
91 ...github.context.repo,
92 release_id: release.id,
93 name: asset,
94 data: await readFile(join(ASSETS_DIR, asset)),
95 });
96 }
97 if (assets.length) console.info('Done');
98 else console.info('No asset to upload');
99}

Callers

nothing calls this directly

Calls 4

ensureReleaseFunction · 0.85
readdirFunction · 0.85
getOctokitFunction · 0.85
filterMethod · 0.80

Tested by

no test coverage detected