diff --git a/.github/actions/lint/action.yml b/.github/actions/lint/action.yml index 6440e7dc5b2..f7a5d2d0f96 100644 --- a/.github/actions/lint/action.yml +++ b/.github/actions/lint/action.yml @@ -26,10 +26,10 @@ runs: 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 + run: ./.github/workflow-scripts/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 + run: ./.github/workflow-scripts/exec_swallow_error.sh yarn lint-java --check - name: Verify not committing repo after running build shell: bash run: yarn run build --check @@ -41,7 +41,7 @@ runs: run: yarn test-typescript - name: Check license shell: bash - run: ./scripts/circleci/check_license.sh + run: ./.github/workflow-scripts/check_license.sh - name: Check formatting shell: bash run: yarn run format-check diff --git a/scripts/circleci/analyze_code.sh b/.github/workflow-scripts/analyze_code.sh similarity index 100% rename from scripts/circleci/analyze_code.sh rename to .github/workflow-scripts/analyze_code.sh diff --git a/scripts/circleci/analyze_scripts.sh b/.github/workflow-scripts/analyze_scripts.sh similarity index 92% rename from scripts/circleci/analyze_scripts.sh rename to .github/workflow-scripts/analyze_scripts.sh index b4fb77f6588..48070697e30 100755 --- a/scripts/circleci/analyze_scripts.sh +++ b/.github/workflow-scripts/analyze_scripts.sh @@ -15,8 +15,7 @@ if [ -x "$(command -v shellcheck)" ]; then if [ -n "$CIRCLE_CI" ]; then results=( "$(find . -type f -not -path "*node_modules*" -not -path "*third-party*" -name '*.sh' -exec sh -c 'shellcheck "$1" -f json' -- {} \;)" ) - cat <(echo shellcheck; printf '%s\n' "${results[@]}" | jq .,[] | jq -s . | jq --compact-output --raw-output '[ (.[] | .[] | . ) ]') | GITHUB_PR_NUMBER="$CIRCLE_PR_NUMBER" node scripts/circleci/code-analysis-bot.js - + cat <(echo shellcheck; printf '%s\n' "${results[@]}" | jq .,[] | jq -s . | jq --compact-output --raw-output '[ (.[] | .[] | . ) ]') | GITHUB_PR_NUMBER="$GITHUB_PR_NUMBER" node packages/react-native-bots/code-analysis-bot.js # check status STATUS=$? if [ $STATUS == 0 ]; then @@ -38,4 +37,3 @@ else echo 'shellcheck is not installed. See https://github.com/facebook/react-native/wiki/Development-Dependencies#shellcheck for instructions.' exit 1 fi - diff --git a/scripts/circleci/check_license.sh b/.github/workflow-scripts/check_license.sh similarity index 89% rename from scripts/circleci/check_license.sh rename to .github/workflow-scripts/check_license.sh index bba12722c7d..53b9dddcbe6 100755 --- a/scripts/circleci/check_license.sh +++ b/.github/workflow-scripts/check_license.sh @@ -7,7 +7,7 @@ set -e # Make sure we don't introduce accidental references to PATENTS. -EXPECTED='scripts/circleci/check_license.sh' +EXPECTED='.github/workflow-scripts/check_license.sh' ACTUAL=$(git grep -l PATENTS) if [ "$EXPECTED" != "$ACTUAL" ]; then diff --git a/scripts/circleci/exec_swallow_error.sh b/.github/workflow-scripts/exec_swallow_error.sh similarity index 100% rename from scripts/circleci/exec_swallow_error.sh rename to .github/workflow-scripts/exec_swallow_error.sh diff --git a/package.json b/package.json index db577f038fe..e07abafb9e9 100644 --- a/package.json +++ b/package.json @@ -16,12 +16,12 @@ "format-check": "prettier --list-different \"./**/*.{js,md,yml,ts,tsx}\"", "format": "npm run prettier && npm run clang-format", "featureflags": "cd packages/react-native && yarn featureflags", - "lint-ci": "./scripts/circleci/analyze_code.sh && yarn shellcheck", + "lint-ci": "./.github/workflow-scripts/analyze_code.sh && yarn shellcheck", "lint-java": "node ./scripts/lint-java.js", "lint": "eslint .", "prettier": "prettier --write \"./**/*.{js,md,yml,ts,tsx}\"", "print-packages": "node ./scripts/monorepo/print", - "shellcheck": "./scripts/circleci/analyze_scripts.sh", + "shellcheck": "./.github/workflow-scripts/analyze_scripts.sh", "start": "cd packages/rn-tester && npm run start", "set-version": "node ./scripts/releases/set-version.js", "test-android": "./gradlew :packages:react-native:ReactAndroid:test",