From 6cea9eb51c36212b9931c744a39e175fba8b36c0 Mon Sep 17 00:00:00 2001 From: undefined Date: Tue, 4 Oct 2022 22:56:22 +0800 Subject: [PATCH] utils: errorMessage: filter unuseful lines [skip-cache] --- .github/workflows/build.yml | 8 +------- packages/utils/lib/utils.ts | 3 +++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67d7e6fc..9344c0a4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,12 +24,6 @@ jobs: - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - name: skip-cache - id: skip-cache - uses: saulmaldonado/skip-workflow@v1 - with: - phrase: 'skip-cache' - github-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions/cache@v3 with: path: | @@ -42,7 +36,7 @@ jobs: cache-${{ github.ref }}- cache- - name: Clear Cache - if: ${{ steps.skip-cache.outputs.skip }} + if: "contains(github.event.head_commit.message, 'skip-cache')" run: | rm -rf node_modules yarn.lock **/tsconfig.tsbuildinfo - name: Config And Install diff --git a/packages/utils/lib/utils.ts b/packages/utils/lib/utils.ts index f51d903e..2821c394 100644 --- a/packages/utils/lib/utils.ts +++ b/packages/utils/lib/utils.ts @@ -162,6 +162,9 @@ export namespace Time { export function errorMessage(err: Error | string) { const t = typeof err === 'string' ? err : err.stack; const parsed = t + .split('\n') + .filter((i) => !i.includes(' (node:')) + .join('\n') .replace(/[A-Z]:\\.+\\@hydrooj\\/g, '@hydrooj\\') .replace(/\/.+\/@hydrooj\//g, '\\') .replace(/[A-Z]:\\.+\\hydrooj\\/g, 'hydrooj\\')