From 4917e38d94ad8dcd89069dc2eb5d544a73098010 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Sun, 29 Jan 2023 18:23:52 -0500 Subject: [PATCH] Separate Stylelint from Superlinter (#23303) --- .github/workflows/lint-css.yml | 48 ++++++++++++++++++++++++++++++++++ .github/workflows/linter.yml | 13 --------- 2 files changed, 48 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/lint-css.yml diff --git a/.github/workflows/lint-css.yml b/.github/workflows/lint-css.yml new file mode 100644 index 000000000..431b88e8d --- /dev/null +++ b/.github/workflows/lint-css.yml @@ -0,0 +1,48 @@ +name: CSS Linting +on: + push: + branches-ignore: + - 'dependabot/**' + paths: + - 'package.json' + - 'yarn.lock' + - '.prettier*' + - 'stylelint.config.js' + - '**/*.css' + - '**/*.scss' + - '.github/workflows/lint-css.yml' + - '.github/stylelint-matcher.json' + + pull_request: + paths: + - 'package.json' + - 'yarn.lock' + - '.prettier*' + - 'stylelint.config.js' + - '**/*.css' + - '**/*.scss' + - '.github/workflows/lint-css.yml' + - '.github/stylelint-matcher.json' + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + cache: yarn + + - name: Install all yarn packages + run: yarn --frozen-lockfile + + - uses: xt0rted/stylelint-problem-matcher@v1 + + - run: echo "::add-matcher::.github/stylelint-matcher.json" + + - name: Stylelint + run: yarn test:lint:sass diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 575732845..58e6fcb25 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -50,19 +50,8 @@ jobs: # Full git history is needed to get a proper list of changed files within `super-linter` fetch-depth: 0 - - name: Set-up Node.js - uses: actions/setup-node@v3 - with: - node-version-file: .nvmrc - cache: yarn - - name: Install dependencies - run: yarn install --frozen-lockfile - name: Set-up RuboCop Problem Mathcher uses: r7kamura/rubocop-problem-matchers-action@v1 - - name: Set-up Stylelint Problem Matcher - uses: xt0rted/stylelint-problem-matcher@v1 - # https://github.com/xt0rted/stylelint-problem-matcher/issues/360 - - run: echo "::add-matcher::.github/stylelint-matcher.json" ################################ # Run Linter against code base # @@ -70,12 +59,10 @@ jobs: - name: Lint Code Base uses: github/super-linter@v4 env: - CSS_FILE_NAME: stylelint.config.js DEFAULT_BRANCH: main NO_COLOR: 1 # https://github.com/xt0rted/stylelint-problem-matcher/issues/360 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} LINTER_RULES_PATH: . RUBY_CONFIG_FILE: .rubocop.yml VALIDATE_ALL_CODEBASE: false - VALIDATE_CSS: true VALIDATE_RUBY: true