diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f5e4edc..3daeeba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,11 +5,11 @@ on: branches: - main pull_request: - branches: main + branches: + - main jobs: main: - if: github.repository == 'getcodelimit/codelimit-action' runs-on: ubuntu-latest permissions: contents: write diff --git a/.gitignore b/.gitignore index b38db2f..5bd3a49 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ build/ +src/version.ts diff --git a/package.json b/package.json index afdbace..f100a4b 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "", "main": "action.js", "scripts": { + "prepare": "node src/generate-versionjs.js > src/version.ts", "build": "tsc", "start": "yarn build && node ./build/action.js", "dist": "yarn build && esbuild build/action.js --bundle --platform=node --outfile=dist/index.js", diff --git a/src/action.ts b/src/action.ts index 5849c4f..c85dac3 100644 --- a/src/action.ts +++ b/src/action.ts @@ -14,6 +14,7 @@ import { import {exec, getExecOutput} from "@actions/exec"; import {downloadCodeLimitBinary, getBadgeContent, getReportContent} from "./codelimit"; import {getChangedFiles} from "./utils"; +import {version} from "./version"; async function generateMarkdownReport(clBinary: string) { const totalsMarkdown = await getExecOutput(clBinary, ['report', '--totals', '--format', 'markdown']); @@ -80,6 +81,8 @@ async function checkChangedFiles(octokit: Octokit, clBinary: string): Promise