diff --git a/.github/scripts/validateActionsAndWorkflows.sh b/.github/scripts/validateActionsAndWorkflows.sh deleted file mode 100755 index b34cfb32edce..000000000000 --- a/.github/scripts/validateActionsAndWorkflows.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash - -source ./scripts/shellUtils.sh - -title 'Validating the Github Actions and workflows using the json schemas provided by (https://www.schemastore.org/json/)' - -function downloadSchema { - [[ $1 = 'github-action.json' ]] && SCHEMA_NAME='GitHub Action' || SCHEMA_NAME='GitHub Workflow' - info "Downloading $SCHEMA_NAME schema..." - if curl "https://raw.githubusercontent.com/SchemaStore/schemastore/refs/heads/master/src/schemas/json/$1" --output "./tempSchemas/$1" --silent; then - success "Successfully downloaded $SCHEMA_NAME schema!" - else - error "Failed downloading $SCHEMA_NAME schema" - exit 1 - fi -} - -# Download the up-to-date json schemas for github actions and workflows -cd ./.github && mkdir ./tempSchemas || exit 1 -downloadSchema 'github-action.json' || exit 1 -downloadSchema 'github-workflow.json' || exit 1 - -# Track exit codes separately so we can run a full validation, report errors, and exit with the correct code -declare EXIT_CODE=0 - -# This stores all the process IDs of the ajv commands so they can run in parallel -declare ASYNC_PROCESSES - -# Arrays of actions and workflows -declare -r ACTIONS=(./actions/*/*/action.yml) -declare -r WORKFLOWS=(./workflows/*.yml) - -info 'Validating actions and workflows against their JSON schemas...' - -# Validate the actions and workflows using the JSON schemas and ajv https://github.com/ajv-validator/ajv-cli -for ((i=0; i < ${#ACTIONS[@]}; i++)); do - ACTION=${ACTIONS[$i]} - ajv -s ./tempSchemas/github-action.json -d "$ACTION" --strict=false & - ASYNC_PROCESSES[i]=$! -done - -for ((i=0; i < ${#WORKFLOWS[@]}; i++)); do - WORKFLOW=${WORKFLOWS[$i]} - ajv -s ./tempSchemas/github-workflow.json -d "$WORKFLOW" --strict=false & - ASYNC_PROCESSES[${#ACTIONS[@]} + i]=$! -done - -# Wait for the background builds to finish -for PID in "${ASYNC_PROCESSES[@]}"; do - wait "$PID" - RESULT=$? - if [[ $RESULT != 0 ]]; then - EXIT_CODE=$RESULT - fi -done - -# Cleanup after ourselves and delete the schemas -rm -rf ./tempSchemas - -title 'Lint Github Actions via actionlint (https://github.com/rhysd/actionlint)' - -# If we are running this on a non-CI machine (e.g. locally), install shellcheck -if [[ -z "${CI}" && -z "$(command -v shellcheck)" ]]; then - if [[ "$OSTYPE" != 'darwin'* || -z "$(command -v brew)" ]]; then - echo 'This script requires shellcheck to be installed. Please install it and try again' - exit 1 - fi - - brew install shellcheck -fi - -info 'Downloading actionlint...' -if bash <(curl --silent https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash); then - success 'Successfully downloaded actionlint!' -else - error 'Error downloading actionlint' - exit 1 -fi - -info 'Linting workflows...' -./actionlint -color || EXIT_CODE=1 -if [[ "$EXIT_CODE" == 0 ]]; then - success 'Workflows passed actionlint!' -fi - -# Cleanup after ourselves and delete actionlint -rm -rf ./actionlint - -exit $EXIT_CODE diff --git a/.github/workflows/validateGithubActions.yml b/.github/workflows/validateGithubActions.yml index 3cc1321af71b..b32588e0b454 100644 --- a/.github/workflows/validateGithubActions.yml +++ b/.github/workflows/validateGithubActions.yml @@ -22,6 +22,3 @@ jobs: # because that would be a sign that the PR author did not rebuild the Github Actions - name: Verify Javascript Action Builds run: ./.github/scripts/verifyActions.sh - - - name: Validate actions and workflows - run: npm run gh-actions-validate diff --git a/package-lock.json b/package-lock.json index 547a9cee93f1..d4d1709f5835 100644 --- a/package-lock.json +++ b/package-lock.json @@ -224,7 +224,6 @@ "@vercel/ncc": "0.38.1", "@vue/preload-webpack-plugin": "^2.0.0", "@welldone-software/why-did-you-render": "7.0.1", - "ajv-cli": "^5.0.0", "babel-jest": "29.7.0", "babel-loader": "^9.1.3", "babel-plugin-module-resolver": "^5.0.0", @@ -15733,50 +15732,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ajv-cli": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^8.0.0", - "fast-json-patch": "^2.0.0", - "glob": "^7.1.0", - "js-yaml": "^3.14.0", - "json-schema-migrate": "^2.0.0", - "json5": "^2.1.3", - "minimist": "^1.2.0" - }, - "bin": { - "ajv": "dist/index.js" - }, - "peerDependencies": { - "ts-node": ">=9.0.0" - }, - "peerDependenciesMeta": { - "ts-node": { - "optional": true - } - } - }, - "node_modules/ajv-cli/node_modules/glob": { - "version": "7.2.3", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/ajv-formats": { "version": "2.1.1", "dev": true, @@ -22772,11 +22727,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fast-json-patch": { - "version": "3.1.1", - "dev": true, - "license": "MIT" - }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "license": "MIT" @@ -28031,14 +27981,6 @@ "version": "2.3.1", "license": "MIT" }, - "node_modules/json-schema-migrate": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^8.0.0" - } - }, "node_modules/json-schema-traverse": { "version": "1.0.0", "dev": true, diff --git a/package.json b/package.json index 3733058d7bf5..1cc3cc12b12a 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,6 @@ "storybook-build": "ENV=production storybook build -o dist/docs", "storybook-build-staging": "ENV=staging storybook build -o dist/docs", "gh-actions-build": "./.github/scripts/buildActions.sh", - "gh-actions-validate": "./.github/scripts/validateActionsAndWorkflows.sh", "analyze-packages": "ANALYZE_BUNDLE=true webpack --config config/webpack/webpack.common.ts --env file=.env.production", "symbolicate:android": "npx metro-symbolicate android/app/build/generated/sourcemaps/react/release/index.android.bundle.map", "symbolicate:ios": "npx metro-symbolicate main.jsbundle.map", @@ -295,7 +294,6 @@ "@vercel/ncc": "0.38.1", "@vue/preload-webpack-plugin": "^2.0.0", "@welldone-software/why-did-you-render": "7.0.1", - "ajv-cli": "^5.0.0", "babel-jest": "29.7.0", "babel-loader": "^9.1.3", "babel-plugin-module-resolver": "^5.0.0",