diff --git a/.github/check-for-missing-Cargo-toml-in-Dependabot-config.sh b/.github/check-for-missing-Cargo-toml-in-Dependabot-config.sh index ff622c09d..4a5ef556b 100755 --- a/.github/check-for-missing-Cargo-toml-in-Dependabot-config.sh +++ b/.github/check-for-missing-Cargo-toml-in-Dependabot-config.sh @@ -7,23 +7,17 @@ DEPENDABOT_YAML=".github/dependabot.yml" -CARGO_FILES_IN_DEPENDABOT_YAML=$(grep package-ecosystem -A1 "$DEPENDABOT_YAML" | grep -A1 cargo | grep directory | cut -f2 -d'"' | sort | while IFS= read -r DIR; do echo ".$DIR/Cargo.toml" | tr -s "//"; done) -echo "INFO: Cargo.toml files found in $DEPENDABOT_YAML" -echo "$CARGO_FILES_IN_DEPENDABOT_YAML" -echo "----- END -----" -echo -echo - -CARGO_FILES_IN_SOURCE_CODE=$(find ./ -name Cargo.toml | sort) +CARGO_FILES_IN_SOURCE_CODE=$(find ./ -name Cargo.toml | grep -v "./target/" | grep -v "/node_modules/" | sort) echo "INFO: Cargo.toml files found in source code" echo "$CARGO_FILES_IN_SOURCE_CODE" echo "----- END -----" echo -echo MISSING_FILES=0 for FILE in $CARGO_FILES_IN_SOURCE_CODE; do - if [[ $CARGO_FILES_IN_DEPENDABOT_YAML = *$FILE* ]]; then + PARENT_DIR=$(dirname "$FILE" | sed "s|^\.|/|" | tr -s "/") + grep -q "\- \"$PARENT_DIR\"" "$DEPENDABOT_YAML" + if [[ $? == "0" ]]; then echo "PASS: $FILE is accounted for in $DEPENDABOT_YAML" else echo "FAIL: $FILE is NOT accounted for in $DEPENDABOT_YAML" diff --git a/.github/check-for-missing-package-json-in-Dependabot-config.sh b/.github/check-for-missing-package-json-in-Dependabot-config.sh index 634d52e55..90784f35b 100755 --- a/.github/check-for-missing-package-json-in-Dependabot-config.sh +++ b/.github/check-for-missing-package-json-in-Dependabot-config.sh @@ -7,23 +7,17 @@ DEPENDABOT_YAML=".github/dependabot.yml" -PACKAGE_JSON_FILES_IN_DEPENDABOT_YAML=$(grep package-ecosystem -A1 "$DEPENDABOT_YAML" | grep -A1 npm | grep directory | cut -f2 -d'"' | sort | while IFS= read -r DIR; do echo ".$DIR/package.json" | tr -s "//"; done) -echo "INFO: package.json files found in $DEPENDABOT_YAML" -echo "$PACKAGE_JSON_FILES_IN_DEPENDABOT_YAML" -echo "----- END -----" -echo -echo - PACKAGE_JSON_FILES_IN_SOURCE_CODE=$(find ./ -name package.json | grep -v node_modules | sort) echo "INFO: package.json files found in source code" echo "$PACKAGE_JSON_FILES_IN_SOURCE_CODE" echo "----- END -----" echo -echo MISSING_FILES=0 for FILE in $PACKAGE_JSON_FILES_IN_SOURCE_CODE; do - if [[ $PACKAGE_JSON_FILES_IN_DEPENDABOT_YAML = *$FILE* ]]; then + PARENT_DIR=$(dirname "$FILE" | sed "s|^\.|/|" | tr -s "/") + grep -q "\- \"$PARENT_DIR\"" "$DEPENDABOT_YAML" + if [[ $? == "0" ]]; then echo "PASS: $FILE is accounted for in $DEPENDABOT_YAML" else echo "FAIL: $FILE is NOT accounted for in $DEPENDABOT_YAML" diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 053275c15..cbb6be941 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -20,122 +20,50 @@ updates: # Maintain dependencies for Rust # Note: Dependabot can't recursively search directories at the moment - package-ecosystem: "cargo" - directory: "/" - schedule: - interval: "monthly" - - - package-ecosystem: "cargo" - directory: "/node" - schedule: - interval: "monthly" - - - package-ecosystem: "cargo" - directory: "/runtime" - schedule: - interval: "monthly" - - - package-ecosystem: "cargo" - directory: "/runtime/generate-bags" - schedule: - interval: "monthly" - - - package-ecosystem: "cargo" - directory: "/client/evm-tracing" - schedule: - interval: "monthly" - - - package-ecosystem: "cargo" - directory: "/client/rpc-core/debug" - schedule: - interval: "monthly" - - - package-ecosystem: "cargo" - directory: "/client/rpc-core/trace" - schedule: - interval: "monthly" - - - package-ecosystem: "cargo" - directory: "/client/rpc-core/types" - schedule: - interval: "monthly" - - - package-ecosystem: "cargo" - directory: "/client/rpc/debug" - schedule: - interval: "monthly" - - - package-ecosystem: "cargo" - directory: "/client/rpc/trace" - schedule: - interval: "monthly" - - - package-ecosystem: "cargo" - directory: "/node/cli-opt" - schedule: - interval: "monthly" - - - package-ecosystem: "cargo" - directory: "/precompiles/substrate-transfer" - schedule: - interval: "monthly" - - - package-ecosystem: "cargo" - directory: "/primitives/account" - schedule: - interval: "monthly" - - - package-ecosystem: "cargo" - directory: "/primitives/core" - schedule: - interval: "monthly" - - - package-ecosystem: "cargo" - directory: "/primitives/ext" - schedule: - interval: "monthly" - - - package-ecosystem: "cargo" - directory: "/primitives/rpc/debug" - schedule: - interval: "monthly" - - - package-ecosystem: "cargo" - directory: "/primitives/rpc/evm-tracing-events" - schedule: - interval: "monthly" - - - package-ecosystem: "cargo" - directory: "/runtime/evm_tracer" + directories: + - "/" + - "/client/evm-tracing" + - "/client/rpc-core/debug" + - "/client/rpc-core/trace" + - "/client/rpc-core/types" + - "/client/rpc/debug" + - "/client/rpc/trace" + - "/node" + - "/node/cli-opt" + - "/precompiles/substrate-transfer" + - "/primitives/account" + - "/primitives/core" + - "/primitives/ext" + - "/primitives/rpc/debug" + - "/primitives/rpc/evm-tracing-events" + - "/runtime" + - "/runtime/evm_tracer" + - "/runtime/generate-bags" + groups: + prod-dependencies: + dependency-type: "production" + applies-to: version-updates + dev-dependencies: + dependency-type: "development" + applies-to: version-updates schedule: interval: "monthly" # Maintain dependencies for Node.js - package-ecosystem: "npm" - directory: "/testing" - schedule: - interval: "monthly" - ignore: - - dependency-name: "*" - update-types: ["version-update:semver-patch"] - - - package-ecosystem: "npm" - directory: "/cli" - schedule: - interval: "monthly" - ignore: - - dependency-name: "*" - update-types: ["version-update:semver-patch"] - - - package-ecosystem: "npm" - directory: "/docs/smart-contract-development/with-hardhat" - schedule: - interval: "monthly" - ignore: - - dependency-name: "*" - update-types: ["version-update:semver-patch"] + directories: + - "/cli" + - "/docs/smart-contract-development/with-hardhat" + - "/docs/smart-contract-development/with-ethers.js" + - "/testing" + groups: + prod-dependencies: + dependency-type: "production" + applies-to: version-updates + dev-dependencies: + dependency-type: "development" + applies-to: version-updates - - package-ecosystem: "npm" - directory: "/docs/smart-contract-development/with-ethers.js" schedule: interval: "monthly" ignore: