From a6f756ab85748d8ec786bdd0d7b61bff67210620 Mon Sep 17 00:00:00 2001 From: Corentin Mors Date: Mon, 10 Jun 2024 16:12:18 +0200 Subject: [PATCH] Fix lint CI trigger --- .github/workflows/tests.yml | 8 +++++++- src/modules/database/vaultContent.ts | 14 ++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 379d4f41..ba4c44e4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,12 @@ name: Run tests & lint -on: [push] +on: + push: + branches: + - master + pull_request: + branches: + - master jobs: build: diff --git a/src/modules/database/vaultContent.ts b/src/modules/database/vaultContent.ts index 5ba61144..8ee2003d 100644 --- a/src/modules/database/vaultContent.ts +++ b/src/modules/database/vaultContent.ts @@ -60,10 +60,10 @@ export const getVaultContent = (path: string): string => { }; export const findVaultContent = (vaultContent: VaultContent, parsedPath: ParsedPath): string => { - let filteredVaultContent: VaultContent = { + const filteredVaultContent: VaultContent = { credentials: [], notes: [], - secrets: [] + secrets: [], }; if (parsedPath.title) { @@ -75,12 +75,18 @@ export const findVaultContent = (vaultContent: VaultContent, parsedPath: ParsedP } if (parsedPath.itemId) { - filteredVaultContent.credentials = vaultContent.credentials.filter((credential) => credential.id === parsedPath.itemId); + filteredVaultContent.credentials = vaultContent.credentials.filter( + (credential) => credential.id === parsedPath.itemId + ); filteredVaultContent.notes = vaultContent.notes.filter((note) => note.id === parsedPath.itemId); filteredVaultContent.secrets = vaultContent.secrets.filter((secret) => secret.id === parsedPath.itemId); } - if (filteredVaultContent.credentials.length === 0 && filteredVaultContent.notes.length === 0 && filteredVaultContent.secrets.length === 0) { + if ( + filteredVaultContent.credentials.length === 0 && + filteredVaultContent.notes.length === 0 && + filteredVaultContent.secrets.length === 0 + ) { throw new Error(`No matching item found for "${parsedPath.itemId ?? parsedPath.title ?? ''}"`); }