From 5aff0713869beda55524cf50e597bebd38b22965 Mon Sep 17 00:00:00 2001 From: codingluke Date: Sun, 8 Dec 2024 14:49:00 +0100 Subject: [PATCH] ci(lint): add linter --- .github/workflows/deploy.yml | 22 +++++++++++++++++++++- .github/workflows/eslint.yml | 17 +++++++++++++++++ neues-projekt/Dockerfile | 2 +- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/eslint.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d074720..ec75a9c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,6 +15,26 @@ permissions: contents: read jobs: + prettier: + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + # Make sure the actual branch is checked out when running on pull requests + ref: ${{ github.head_ref }} + # This is important to fetch the changes to the previous commit + fetch-depth: 0 + - name: Prettify code + uses: creyD/prettier_action@v4.3 + with: + # This part is also where you can pass other options, for example: + same_commit: true + prettier_options: --write **/*.{js,md} + only_changed: true # Prüft nur Dateien die geändert wurden test: name: Test runs-on: ubuntu-latest @@ -39,7 +59,7 @@ jobs: name: Deploy runs-on: ubuntu-latest environment: aws - needs: test + needs: [test, prettier] steps: - name: Checkout diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml new file mode 100644 index 0000000..4c653ea --- /dev/null +++ b/.github/workflows/eslint.yml @@ -0,0 +1,17 @@ +name: Lint +on: [push] +jobs: + eslint_check: + name: Prepare action + runs-on: ubuntu-latest + steps: + # Checkout action must run prior to eslint check + - name: Checkout + uses: actions/checkout@v4 + - name: Lint + uses: Krizzu/eslint-check-action@v1.1.0 + with: + ghToken: ${{ secrets.GITHUB_TOKEN }} + # eslintFiles: "." + # eslintConfig: "myConfigs/eslint.config.js" + # eslintExt: "js, ts, jsx, tsx" diff --git a/neues-projekt/Dockerfile b/neues-projekt/Dockerfile index 0624365..f1d08b0 100644 --- a/neues-projekt/Dockerfile +++ b/neues-projekt/Dockerfile @@ -17,7 +17,7 @@ COPY . . RUN npm ci && npm run test:ci && npm run build -# Ab hier beginnt das Produktive Image! +# Ab hier beginnt das produktive Image! FROM node:lts-slim # Das LABEL muss hier gesetzt sein!