- Introduced core files including Dockerfile, action.yml, and entry point script (bin/polinrider.js) for the PolinRider malware scanner. - Created configuration files: .env.example, .gitignore, and .npmrc for environment setup and dependency management. - Added CI workflows for testing, building, and releasing the action, along with examples for usage in GitHub Actions. - Implemented a README.md to provide documentation on usage, features, and setup instructions. - Included necessary scripts for building the action and handling security measures during execution. - Established a structured directory for reports and workspace management within Docker. - Ensured all files are set up for a secure and efficient scanning process of GitHub repositories for PolinRider malware.
32 lines
1023 B
JavaScript
32 lines
1023 B
JavaScript
/**
|
|
* Bundle the GitHub Action entrypoint (src/ci.js) into a single self-contained
|
|
* dist/ci.mjs that the action runner executes with no install step.
|
|
*
|
|
* The banner shims `require`/`__dirname`/`__filename` because some transitive
|
|
* CJS deps of execa (e.g. cross-spawn) call `require('child_process')`, which
|
|
* does not exist in an ESM bundle without this.
|
|
*/
|
|
import { build } from "esbuild";
|
|
|
|
const banner = [
|
|
"import { createRequire as __createRequire } from 'node:module';",
|
|
"import { fileURLToPath as __fileURLToPath } from 'node:url';",
|
|
"import { dirname as __pathDirname } from 'node:path';",
|
|
"const require = __createRequire(import.meta.url);",
|
|
"const __filename = __fileURLToPath(import.meta.url);",
|
|
"const __dirname = __pathDirname(__filename);",
|
|
].join("\n");
|
|
|
|
await build({
|
|
entryPoints: ["src/ci.js"],
|
|
bundle: true,
|
|
platform: "node",
|
|
format: "esm",
|
|
target: "node20",
|
|
outfile: "dist/ci.mjs",
|
|
banner: { js: banner },
|
|
legalComments: "none",
|
|
});
|
|
|
|
console.log("built dist/ci.mjs");
|