From c46f568bd5f884f8574e6bf817df4a02731636cf Mon Sep 17 00:00:00 2001 From: Matthew Gladman Date: Wed, 22 Mar 2023 18:22:52 +1100 Subject: [PATCH 1/3] Use check-runs --- .github/workflows/node.js.yml | 6 +++++- src/middlewares/LambdaEventMiddleware.ts | 2 +- src/tests/SimpleRoute.test.ts | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index efb6037..c375d91 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -24,4 +24,8 @@ jobs: npm install sfdx-cli npx sfdx plugins:install @salesforce/sfdx-scanner - name: SFDX Scanner - uses: mattisdada/sfdx-scan-pull-request@main + uses: mattisdada/sfdx-scan-pull-request@ts-port + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + report-mode: check-runs diff --git a/src/middlewares/LambdaEventMiddleware.ts b/src/middlewares/LambdaEventMiddleware.ts index 5282527..59fd85f 100644 --- a/src/middlewares/LambdaEventMiddleware.ts +++ b/src/middlewares/LambdaEventMiddleware.ts @@ -1,6 +1,6 @@ import { HttpRequest } from "../HttpRequest"; import { HttpResponse } from "../HttpResponse"; -import { BeforeMiddleware } from "../SimpleRouter"; +import { BeforeMiddleware, HttpCodes } from "../SimpleRouter"; export class LambdaEventMiddleware implements BeforeMiddleware { async before(request: HttpRequest, response: HttpResponse, context: any) { diff --git a/src/tests/SimpleRoute.test.ts b/src/tests/SimpleRoute.test.ts index 25e9311..c04386f 100644 --- a/src/tests/SimpleRoute.test.ts +++ b/src/tests/SimpleRoute.test.ts @@ -1,4 +1,6 @@ -import { AfterMiddleware, BeforeMiddleware, HttpCodes, HttpRequest, HttpResponse, Router } from "../SimpleRouter"; +import { AfterMiddleware, BeforeMiddleware, HttpCodes, Router } from "../SimpleRouter"; +import { HttpRequest } from "../HttpRequest"; +import { HttpResponse } from "../HttpResponse"; test("create middleware", async () => { //const router = new Router(); From c36effd9f81d2ce7c51ac5dc5a258cef53e27eda Mon Sep 17 00:00:00 2001 From: Matthew Gladman Date: Thu, 13 Apr 2023 18:55:14 +1000 Subject: [PATCH 2/3] Force a failure --- .github/workflows/node.js.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index c375d91..6b0b95b 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -29,3 +29,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: report-mode: check-runs + severity-threshold: 3 From 262d165655c2a4855cd2bdee96b7211d0f43a3c4 Mon Sep 17 00:00:00 2001 From: Matthew Gladman Date: Thu, 13 Apr 2023 19:04:09 +1000 Subject: [PATCH 3/3] Force a failure 2 --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 6b0b95b..34e902e 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -29,4 +29,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: report-mode: check-runs - severity-threshold: 3 + severity-threshold: 1