-
Notifications
You must be signed in to change notification settings - Fork 8
feat: new secscan action #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
6812dcd
30d09a2
9ce60e4
827641e
80808f5
bd2db59
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import * as esbuild from "esbuild"; | ||
|
|
||
| const [entryPoint, outfile] = process.argv.slice(2); | ||
|
|
||
| if (!entryPoint || !outfile) { | ||
| console.error("Usage: node build.mjs <entryPoint> <outfile>"); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| await esbuild.build({ | ||
| entryPoints: [entryPoint], | ||
| bundle: true, | ||
| platform: "node", | ||
| target: "node24", | ||
| format: "esm", | ||
| outfile, | ||
| banner: { | ||
| js: "import { createRequire as __require__ } from 'module'; globalThis.require = __require__(import.meta.url);", | ||
| }, | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // @ts-check | ||
| import js from "@eslint/js"; | ||
| import { defineConfig } from "eslint/config"; | ||
| import tseslint from "typescript-eslint"; | ||
|
|
||
| export default defineConfig([ | ||
| { | ||
| ignores: ["**/dist/**", "**/node_modules/**", "docs/**"], | ||
| }, | ||
| { | ||
| files: ["**/*.ts"], | ||
| extends: [js.configs.recommended, tseslint.configs.recommended], | ||
| languageOptions: { | ||
| parserOptions: { | ||
| projectService: true, | ||
| tsconfigRootDir: import.meta.dirname, | ||
| }, | ||
| }, | ||
| }, | ||
| ]); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "name": "starflow", | ||
| "version": "0.0.1", | ||
| "description": "A set of GitHub Actions used by the craft tools and libraries.", | ||
| "private": true, | ||
| "scripts": { | ||
| "build": "pnpm -r run build", | ||
| "test": "pnpm -r run test", | ||
| "lint": "eslint . && tsc --noEmit" | ||
|
Comment on lines
+7
to
+9
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Each of these can be run at the root of the project as Actions here are overridden by actions of the same name in subdirectories. |
||
| }, | ||
| "keywords": [], | ||
| "author": "", | ||
| "license": "GPL-3.0-only", | ||
| "devEngines": { | ||
| "packageManager": { | ||
| "name": "pnpm", | ||
| "version": "^11.7.0", | ||
| "onFail": "warn" | ||
| } | ||
| }, | ||
| "type": "module", | ||
| "devDependencies": { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These dependencies are inherited by subdirectories and are common dependencies other actions may want. It's the compiler, the testing framework, and the linter. |
||
| "@eslint/js": "^10.0.1", | ||
| "@types/node": "^25.9.3", | ||
| "esbuild": "^0.28.1", | ||
| "eslint": "^10.5.0", | ||
| "typescript": "^6.0.3", | ||
| "typescript-eslint": "^8.61.1", | ||
| "vitest": "^4.1.9" | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This prepends the string to
dist/index.jsfor each built action. The string fixes an issue that's frankly really convoluted and circular and exemplifies the Node ecosystem. TL;DR, there's multiple "kinds" of Node scripts and modern TypeScript is not the same "kind" as the flattened JavaScript we need to output for GitHub Actions, and this is mostly fine but it caused some confusion around therequirefunction and this is the workaround that the internet recommends.