Skip to content

Commit 1930529

Browse files
huntiemeta-codesync[bot]
authored andcommitted
Delete unused code-analysis script (#55421)
Summary: Pull Request resolved: #55421 Deletes the largely unused `analyze_code`/`code-analysis-bot` script, which was part of our earlier CircleCI infra. **Motivation** - **Security**: Removes another use of a `GITHUB_TOKEN` env var being loaded into a script in our CI (similar to S603729). - **Cleanup**: This script attempted to read various lint job results (including google-java-format, which is no longer present), and post a GitHub PR comment for >5 issues. In a GitHub Actions world, we don't really need this functionality. **Other changes** - The `yarn shellcheck` run from this script was load bearing, and is moved directly into the `lint` action. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D92407627 fbshipit-source-id: ef5664a273ad4aac721dbb53de73f2b96b47d75b
1 parent ab36cdc commit 1930529

6 files changed

Lines changed: 2 additions & 391 deletions

File tree

.github/actions/lint/action.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ inputs:
55
description: "The node.js version to use"
66
required: false
77
default: "22"
8-
github-token:
9-
description: "The GitHub token used by pull-bot"
10-
required: true
118
runs:
129
using: composite
1310
steps:
@@ -17,12 +14,9 @@ runs:
1714
node-version: ${{ inputs.node-version }}
1815
- name: Run yarn install
1916
uses: ./.github/actions/yarn-install
20-
- name: Run linters against modified files (analysis-bot)
17+
- name: Run shellcheck
2118
shell: bash
22-
run: yarn lint-ci
23-
env:
24-
GITHUB_TOKEN: ${{ inputs.github-token }}
25-
GITHUB_PR_NUMBER: ${{ github.event.number }}
19+
run: yarn shellcheck
2620
- name: Lint code
2721
shell: bash
2822
run: ./.github/workflow-scripts/exec_swallow_error.sh yarn lint --format junit -o ./reports/junit/eslint/results.xml

.github/workflow-scripts/analyze_code.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/test-all.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,6 @@ jobs:
511511
uses: actions/checkout@v6
512512
- name: Run all the linters
513513
uses: ./.github/actions/lint
514-
with:
515-
github-token: ${{ env.GH_TOKEN }}
516514

517515
build_debugger_shell:
518516
runs-on: ubuntu-latest

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"format": "npm run prettier && npm run clang-format",
1818
"featureflags": "yarn --cwd packages/react-native featureflags",
1919
"js-api-diff": "node ./scripts/js-api/diff-api-snapshot",
20-
"lint-ci": "./.github/workflow-scripts/analyze_code.sh && yarn shellcheck",
2120
"lint-kotlin-check": "./gradlew ktfmtCheck",
2221
"lint-kotlin": "./gradlew ktfmtFormat",
2322
"lint-markdown": "markdownlint-cli2 2>&1",

private/react-native-bots/README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,3 @@ So, for example:
1212
cd private/react-native-bots && yarn
1313
DANGER_GITHUB_API_TOKEN=ghp_<REDACTED> yarn danger pr https://github.com/facebook/react-native/pull/1234
1414
```
15-
16-
## Code Analysis Bot
17-
18-
The code analysis bot provides lint and other results as inline reviews on GitHub. It runs as part of the Circle CI analysis workflow.
19-
20-
If you want to test changes to the Code Analysis Bot, I'd recommend checking out an existing PR and then running the `analyze pr` command.
21-
You'll need a GitHub token. You can re-use this one: `312d354b5c36f082cfe9` `07973d757026bdd9f196` (just remove the space).
22-
So, for example:
23-
24-
```
25-
GITHUB_TOKEN=[ENV_ABOVE] GITHUB_PR_NUMBER=1234 yarn lint-ci
26-
```

0 commit comments

Comments
 (0)