From 10ebc94cac3357c79d0c257ab3d02e8a0e9e41ed Mon Sep 17 00:00:00 2001 From: IvanZosimov Date: Tue, 29 Nov 2022 15:51:17 +0100 Subject: [PATCH] Fix review points --- .github/workflows/basic-validation.yml | 24 +++--------------------- .github/workflows/check-dist.yml | 7 +------ .github/workflows/codeql-analysis.yml | 19 ++++++++++--------- .github/workflows/licensed.yml | 8 +------- 4 files changed, 15 insertions(+), 43 deletions(-) diff --git a/.github/workflows/basic-validation.yml b/.github/workflows/basic-validation.yml index 02746aa..506a7d8 100644 --- a/.github/workflows/basic-validation.yml +++ b/.github/workflows/basic-validation.yml @@ -14,21 +14,6 @@ on: required: false type: string default: "['ubuntu-latest', 'windows-latest', 'macos-latest']" - build-command: - description: "Optional input to configure build command in case the default one doesn't suit. Set to an empty string if build isn't needed. Multiline syntax is supported" - required: false - type: string - default: "npm run build" - prettier-command: - description: "Optional input to set prettier command. Set to an empty string if prettiering isn't needed" - required: false - type: string - default: "npm run format-check" - linter-command: - description: "Optional input to set linter command. Set to an empty string if linting isn't needed" - required: false - type: string - default: "npm run lint" enable-audit: description: "Optional input to enable npm package audit process" required: false @@ -66,16 +51,13 @@ jobs: run: npm ci --ignore-scripts - name: Run prettier - if: ${{inputs.prettier-command}} - run: ${{inputs.prettier-command}} + run: npm run format-check - name: Run linter - if: ${{inputs.linter-command}} - run: ${{inputs.linter-command}} + run: npm run lint - name: Build - if: ${{inputs.build-command}} - run: ${{inputs.build-command}} + run: npm run build - name: Test run: npm test diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml index d46a596..6f95b64 100644 --- a/.github/workflows/check-dist.yml +++ b/.github/workflows/check-dist.yml @@ -12,11 +12,6 @@ on: required: false type: string default: "./dist" - build-command: - description: "Optional input to configure build command in case the default one doesn't suit. If it's not set, defaults to 'npm run build'" - required: false - type: string - default: "npm run build" node-version: description: "Optional input to set version of Node.js used to build a project. The input syntax corresponds to the setup-node's one" required: false @@ -47,7 +42,7 @@ jobs: run: npm ci --ignore-scripts - name: Rebuild the dist directory - run: ${{inputs.build-command}} + run: npm run build - name: Compare the expected and actual dist directories run: | diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b19c21b..e36234c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -7,11 +7,10 @@ name: CodeQL on: workflow_call: inputs: - languages: - description: "Optional input to set languages for CodeQL check. Supported values are: 'cpp', 'csharp', 'go', 'java', 'javascript', 'typescript', 'python', 'ruby'. To use multiple languages use the same syntax as used in the default value." + codeql-cfg-path: + description: "Optional input to set path to the CodeQL config file" required: false type: string - default: "['javascript']" build-command: description: "Optional input to specify manual build command. Multiline syntax is supported" required: false @@ -26,20 +25,22 @@ jobs: contents: read security-events: write - strategy: - fail-fast: false - matrix: - language: ${{fromJson(inputs.languages)}} - steps: - name: Checkout uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL + if: ${{!inputs.codeql-cfg-path}} + uses: github/codeql-action/init@v2 + + - name: Initialize CodeQL with config file + if: ${{inputs.codeql-cfg-path}} uses: github/codeql-action/init@v2 with: - languages: ${{ matrix.language }} + config-file: ${{inputs.codeql-cfg-path}} + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, configure a build command manually using build-command input. This command will be executed in the corresponding step. diff --git a/.github/workflows/licensed.yml b/.github/workflows/licensed.yml index 31fc2bd..67f0aec 100644 --- a/.github/workflows/licensed.yml +++ b/.github/workflows/licensed.yml @@ -5,12 +5,6 @@ name: Licensed on: workflow_call: - inputs: - licensed-url: - description: "Optional input to set the url of the required version of the Licenced tool" - required: false - type: string - default: "https://github.com/github/licensed/releases/download/3.9.0/licensed-3.9.0-linux-x64.tar.gz" jobs: validate-cached-dependency-records: @@ -27,7 +21,7 @@ jobs: - name: Install licensed tool run: | cd $RUNNER_TEMP - curl -Lfs -o licensed.tar.gz ${{inputs.licensed-url}} + curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/3.9.0/licensed-3.9.0-linux-x64.tar.gz sudo tar -xzf licensed.tar.gz sudo mv licensed /usr/local/bin/licensed