Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: linting using changed-files gh action #1799

Merged
merged 3 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading