Feat: tela de registro #760
This file contains 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: Code Style | |
on: | |
pull_request: | |
branches: ['master'] | |
push: | |
branches: ['master'] | |
jobs: | |
code-style: | |
runs-on: ubuntu-latest | |
name: code-style | |
steps: | |
- name: Code Checkout | |
uses: actions/checkout@v3 | |
- name: Setup deps | |
uses: devhatt/workflows/.github/actions/pnpm-setup@main | |
- name: Get all changed files | |
id: all-changed-files | |
uses: tj-actions/changed-files@v41 | |
with: | |
files: | | |
!pnpm-lock.yaml | |
- name: Run prettier in all files | |
if: steps.all-changed-files.outputs.any_changed == 'true' | |
env: | |
files: ${{ steps.all-changed-files.outputs.all_changed_files }} | |
run: pnpm exec prettier $files --check --ignore-unknown | |
- name: Get specific changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v41 | |
with: | |
files_yaml: | | |
code: | |
- '**.js' | |
- '**.ts' | |
- '**.tsx' | |
- '**.jsx' | |
- '**.mjs' | |
- '**.cjs' | |
style: | |
- '**.scss' | |
- '**.css' | |
- name: Run stylelint in scss files | |
if: steps.changed-files.outputs.style_any_changed == 'true' | |
env: | |
files: ${{ steps.changed-files.outputs.style_all_changed_files }} | |
run: pnpm exec stylelint $files --allow-empty-input | |
- name: Run eslint in code files | |
if: steps.changed-files.outputs.code_any_changed == 'true' | |
env: | |
files: ${{ steps.changed-files.outputs.code_all_changed_files }} | |
run: pnpm exec eslint $files --report-unused-disable-directives --max-warnings 0 --output-file eslint_report.json --format json | |
- name: Annotate Code Linting Results | |
if: ${{ always() && !github.event.pull_request.head.repo.fork && steps.changed-files.outputs.code_any_changed == 'true' }} | |
uses: ataylorme/eslint-annotate-action@v2 | |
with: | |
repo-token: '${{ secrets.GITHUB_TOKEN }}' | |
report-json: 'eslint_report.json' |