From 52f651358d272a6b8b3ffcc9c49c0c589f54554c Mon Sep 17 00:00:00 2001 From: Rob van der Leek <5324924+robvanderleek@users.noreply.github.com> Date: Fri, 6 Dec 2024 22:17:59 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20Log=20context?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 4 ++-- .gitignore | 1 + package.json | 1 + src/action.ts | 3 +++ src/generate-versionjs.js | 3 +++ yarn.lock | 6 +++--- 6 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 src/generate-versionjs.js 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