Skip to content

Commit

Permalink
feat: linting using changed-files gh action (#1799)
Browse files Browse the repository at this point in the history
* feat: linting using changed-files gh action

* fix: the way env is passed

* test: changed 2 files to test
  • Loading branch information
NamitBhutani authored Feb 6, 2024
1 parent ee6c33e commit e69119f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
steps:
- name: Checkout repository content
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Count number of lines
run: |
Expand All @@ -49,8 +51,17 @@ jobs:
- name: Install Dependencies
run: npm ci

- name: Get changed files
id: changed_files
uses: tj-actions/changed-files@v42
with:
files: |
**.ts
- name: Run ESLint to check for linting errors in modified files
run: npx eslint $(git diff --name-only --diff-filter=d ${{ github.sha }}^1 -- '***.ts')
env:
CHANGED_FILES: ${{ steps.changed_files.outputs.all_changed_files }}
run: npx eslint ${CHANGED_FILES}

- name: Check for formatting errors
run: npm run format:check
Expand Down
1 change: 0 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { appConfig } from "./config";
import { requestContext, requestTracing, stream } from "./libraries";
//@ts-ignore
import graphqlUploadExpress from "graphql-upload/graphqlUploadExpress.mjs";

const app = express();

app.use(requestTracing.middleware());
Expand Down
1 change: 0 additions & 1 deletion src/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { User } from "./models";
import { generateErrorMessage } from "zod-error";
import { getEnvIssues } from "./env";
import { logger } from "./libraries";

const logWarningForSuperAdminEnvVariable = async (): Promise<void> => {
const superAdminExist = await User.exists({ userType: "SUPERADMIN" });
const isVariablePresentInEnvFile = !!LAST_RESORT_SUPERADMIN_EMAIL;
Expand Down

0 comments on commit e69119f

Please sign in to comment.