diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index 1b0464a575a3..1cd9768053c4 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -23,10 +23,7 @@ jobs: - name: Create and use reduced-dependencies package.json run: | - jq '.devDependencies |= with_entries( - select(.key | test("prefix|hugo|css")) - ) - | del(.dependencies, .optionalDependencies)' \ + jq 'del(.dependencies, .optionalDependencies)' \ package.json > tmp/package-min.json cp tmp/package-min.json package.json @@ -38,18 +35,9 @@ jobs: - run: npm install --omit=optional - - name: Fetch all submodules at HEAD - run: npm run update:submodule - - - name: - Revert to pinned versions of submodules except for - submodule_path_regex - run: npm run _pin -- ${{ inputs.submodule_path_regex }} - - run: npm run log:test-and-fix - continue-on-error: true env: - GET: no + PIN_SKIP: ${{ inputs.submodule_path_regex }} - uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/pr-actions.yml b/.github/workflows/pr-actions.yml index 078a6665e6ac..9a9bf1c7b725 100644 --- a/.github/workflows/pr-actions.yml +++ b/.github/workflows/pr-actions.yml @@ -31,7 +31,7 @@ jobs: run: | PR_ACTION=$(echo $COMMENT | grep -oP '/fix:\K\w+') echo "Action is $PR_ACTION" - ACTION_NAMES="all|dict|filenames|format|i18n|markdown|refcache|submodules|text" + ACTION_NAMES="all|dict|filenames|format|i18n|markdown|refcache|submodules?|text" if [[ ! "$PR_ACTION" =~ ^($ACTION_NAMES)$ ]]; then echo "Invalid action name: $PR_ACTION" echo "Action name should be one of: $ACTION_NAMES" @@ -72,7 +72,7 @@ jobs: all|refcache) npm install --omit=optional ;& - dict|filenames|format|markdown|submodules) + dict|filenames|format|markdown|submodule*) npm run fix:$PR_ACTION ;; esac diff --git a/package.json b/package.json index 49dad6c0a0a1..741c6aac9685 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "_filename-error": "echo 'ERROR: the following files violate naming conventions; fix using: `npm run fix:filenames`'; echo; npm run -s _ls-bad-filenames; exit 1", "_fix:most": "npm run all -- $(npm -s run _list:fix:* | grep -Ev 'refcache|submodule')", "_get:no": "echo SKIPPING get operation", - "_get:submodule:non-lang": "npm run _get:submodule -- content-modules/opentelemetry-specification themes/docsy", "_get:submodule": "set -x && git submodule update --init ${DEPTH:- --depth 999}", "_hugo": "hugo --cleanDestinationDir", "_install:dict": "npm install -D $(npm run -s _list:dict)", @@ -32,7 +31,7 @@ "_list:dict": "grep '^\\s*\"@cspell' package.json | awk -F: '{print $1}' | tr -d '\"'", "_list:fix:*": "npm run --loglevel=warn | grep -Ee '^\\s*fix:[^:]+$' | grep -v 'fix:all'", "_ls-bad-filenames": "find assets content static -name '*_*' ! -name '[_.]*'", - "_pin": "scripts/pin-submodules.pl", + "_pin:submodule": "scripts/pin-submodules.pl", "_prebuild": "npm run seq -- get:submodule cp:spec", "_prepare:docsy": "cd themes/docsy && npm install", "_prettier:any": "npx prettier --ignore-path ''", @@ -71,7 +70,7 @@ "fix:i18n": "npm run fix:i18n:new", "fix:markdown": "npm run check:markdown -- --fix", "fix:refcache": "npm run check:links", - "fix:submodules": "npm run update:submodule && npm run _pin", + "fix:submodule": "npm run pin:submodule", "fix:text": "npm run check:text -- --fix", "fix": "npm run fix:all", "format": "npm run _check:format -- --write && npm run _check:format:ja+zh -- --write", @@ -81,13 +80,15 @@ "make:public": "make public ls-public", "netlify-build:preview": "npm run seq -- build:preview diff:check", "netlify-build:production": "npm run seq -- build:production diff:check", + "pin:submodule": "npm run _pin:submodule -- $PIN_SKIP", + "postfix:submodule": "git submodule", "postget:submodule": "git submodule", "prebuild:preview": "npm run _prebuild", "prebuild:production": "npm run _prebuild", "prebuild": "npm run _prebuild", "precheck:links:internal": "npm run build && npm run update:htmltest-config", "precheck:links": "npm run build && npm run update:htmltest-config", - "prefix:submodules": "npm run update:submodule", + "prefix:submodule": "npm run update:submodule", "prepare": "npm run seq -- get:submodule _prepare:docsy", "preserve:hugo": "npm run _prebuild", "preserve:netlify": "npm run seq -- _prebuild _install:netlify-cli", @@ -96,7 +97,7 @@ "serve:hugo": "npm run _serve:hugo -- --renderToMemory", "serve:netlify": "npm run _serve:netlify", "serve": "npm run serve:hugo --", - "test-and-fix": "npm run seq -- fix:submodules _fix:most test", + "test-and-fix": "npm run seq -- fix:submodule _fix:most test", "test": "npm run check", "update:htmltest-config": "scripts/htmltest-config.sh", "update:pkg:hugo": "npm install --save-dev --save-exact hugo-extended@latest",