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
This commit is contained in:
Riccardo Cipolleschi 2024-09-18 02:57:48 -07:00 committed by Facebook GitHub Bot
parent 405d982854
commit 6d61899fc5
2 changed files with 2 additions and 1 deletions

View File

@ -23,6 +23,7 @@ runs:
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

View File

@ -9,7 +9,7 @@ GITHUB_REPO=${CIRCLE_PROJECT_REPONAME:-react-native}
export GITHUB_OWNER
export GITHUB_REPO
cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow-check --silent --json; echo flow; echo google-java-format; node scripts/lint-java.js --diff) | GITHUB_PR_NUMBER="$CIRCLE_PR_NUMBER" node packages/react-native-bots/code-analysis-bot.js
cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow-check --silent --json; echo google-java-format; node scripts/lint-java.js --diff) | node packages/react-native-bots/code-analysis-bot.js
STATUS=$?
if [ $STATUS == 0 ]; then