Files
react-native/.github/actions/lint/action.yml
Riccardo Cipolleschi 6d61899fc5 Fix analyze_code to use the proper PR number (#46548)
Summary:
Analyze code was still using the CIRCLECI env variable to retrieve the PR number.
This change uses the github one and also removes a duplicated flow check

## Changelog:
[Internal] - Remove duplicated flow check and use gh PR number rather than CircleCI one

Pull Request resolved: https://github.com/facebook/react-native/pull/46548

Test Plan: Tested locally and in CI

Reviewed By: NickGerleman

Differential Revision: D62883758

Pulled By: cipolleschi

fbshipit-source-id: 0c7e97ea9caf4465972424e0b69a899ecfd07095
2024-09-18 02:57:48 -07:00

45 lines
1.3 KiB
YAML

name: lint
description: Runs all the linters in the codebase
inputs:
node-version:
description: "The node.js version to use"
required: false
default: "18"
github-token:
description: "The GitHub token used by pull-bot"
required: true
runs:
using: composite
steps:
- name: Setup node.js
uses: ./.github/actions/setup-node
with:
node-version: ${{ inputs.node-version }}
- name: Yarn install
shell: bash
run: yarn install --non-interactive --frozen-lockfile
- name: Run linters against modified files (analysis-bot)
shell: bash
run: yarn lint-ci
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
GITHUB_PR_NUMBER: ${{ github.event.number }}
- name: Lint code
shell: bash
run: ./scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ./reports/junit/eslint/results.xml
- name: Lint java
shell: bash
run: ./scripts/circleci/exec_swallow_error.sh yarn lint-java --check
- name: Run flowcheck
shell: bash
run: yarn flow-check
- name: Run typescript check
shell: bash
run: yarn test-typescript
- name: Check license
shell: bash
run: ./scripts/circleci/check_license.sh
- name: Check formatting
shell: bash
run: yarn run format-check