chore: update dependency pretty-bytes to v7.0.1 #1813
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint | |
# | |
# This workflow lints the library and reports back suggested fixes | |
# | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- auto_merge_enabled | |
permissions: | |
contents: read | |
pull-requests: write | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
# ------------------------------------------------------------- | |
# Returns all changed pull request files. | |
# -------------------------------------------------------------- | |
changed_files: | |
runs-on: ubuntu-latest | |
name: Capture changed-files | |
outputs: | |
styles_added_files: ${{ steps.changed-files.outputs.styles_added_files }} | |
styles_modified_files: ${{ steps.changed-files.outputs.styles_modified_files }} | |
eslint_added_files: ${{ steps.changed-files.outputs.eslint_added_files }} | |
eslint_modified_files: ${{ steps.changed-files.outputs.eslint_modified_files }} | |
permissions: | |
pull-requests: read | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Get changed files | |
id: changed-files | |
uses: step-security/changed-files@v46 | |
with: | |
files_yaml: | | |
styles: | |
- '*.css' | |
- '**/*.css' | |
eslint: | |
- '*.{js,json,ts}' | |
- '**/*.{js,json,ts}' | |
- '!*.d.ts' | |
- '!**/*.d.ts' | |
# --- Lint pre-compiled assets for consistency --- # | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
needs: [changed_files] | |
timeout-minutes: 5 | |
steps: | |
# install but don't build - we're linting pre-compiled assets | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Use Node LTS version | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: yarn | |
- name: Enable Corepack | |
run: corepack enable | |
## --- YARN CACHE --- ## | |
- name: Check for cached dependencies | |
continue-on-error: true | |
id: cache-dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
.cache/yarn | |
node_modules | |
key: ubuntu-latest-node20-${{ hashFiles('yarn.lock') }} | |
## --- INSTALL --- ## | |
# If statement isn't needed here b/c yarn will leverage the cache if it exists | |
- name: Install dependencies | |
shell: bash | |
run: yarn install --immutable | |
- name: Lint styles | |
if: ${{ needs.changed_files.outputs.styles_added_files != '' || needs.changed_files.outputs.styles_modified_files != '' }} | |
uses: reviewdog/action-stylelint@v1.30.2 | |
with: | |
fail_level: error | |
filter_mode: diff_context | |
level: error | |
reporter: github-pr-review | |
stylelint_input: '${{ needs.changed_files.outputs.styles_added_files }} ${{ needs.changed_files.outputs.styles_modified_files }} --allow-empty-input' | |
stylelint_config: '${{ github.workspace }}/.stylelintrc.json' | |
packages: 'stylelint-header stylelint-config-standard' | |
- name: ESLint | |
uses: reviewdog/action-eslint@v1.33.2 | |
if: ${{ needs.changed_files.outputs.eslint_added_files != '' || needs.changed_files.outputs.eslint_modified_files != '' }} | |
with: | |
fail_level: error | |
level: error | |
reporter: github-pr-review | |
filter_mode: diff_context | |
eslint_flags: '${{ needs.changed_files.outputs.eslint_added_files }} ${{ needs.changed_files.outputs.eslint_modified_files }}' |