Skip to content

Commit 1d87449

Browse files
authored
[CI] build-dev workflow: use PIN_SKIP (#5563)
1 parent 59ae71f commit 1d87449

File tree

3 files changed

+10
-21
lines changed

3 files changed

+10
-21
lines changed

.github/workflows/build-dev.yml

+2-14
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ jobs:
2323
2424
- name: Create and use reduced-dependencies package.json
2525
run: |
26-
jq '.devDependencies |= with_entries(
27-
select(.key | test("prefix|hugo|css"))
28-
)
29-
| del(.dependencies, .optionalDependencies)' \
26+
jq 'del(.dependencies, .optionalDependencies)' \
3027
package.json > tmp/package-min.json
3128
cp tmp/package-min.json package.json
3229
@@ -38,18 +35,9 @@ jobs:
3835

3936
- run: npm install --omit=optional
4037

41-
- name: Fetch all submodules at HEAD
42-
run: npm run update:submodule
43-
44-
- name:
45-
Revert to pinned versions of submodules except for
46-
submodule_path_regex
47-
run: npm run _pin -- ${{ inputs.submodule_path_regex }}
48-
4938
- run: npm run log:test-and-fix
50-
continue-on-error: true
5139
env:
52-
GET: no
40+
PIN_SKIP: ${{ inputs.submodule_path_regex }}
5341

5442
- uses: actions/upload-artifact@v4
5543
with:

.github/workflows/pr-actions.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: |
3232
PR_ACTION=$(echo $COMMENT | grep -oP '/fix:\K\w+')
3333
echo "Action is $PR_ACTION"
34-
ACTION_NAMES="all|dict|filenames|format|i18n|markdown|refcache|submodules|text"
34+
ACTION_NAMES="all|dict|filenames|format|i18n|markdown|refcache|submodules?|text"
3535
if [[ ! "$PR_ACTION" =~ ^($ACTION_NAMES)$ ]]; then
3636
echo "Invalid action name: $PR_ACTION"
3737
echo "Action name should be one of: $ACTION_NAMES"
@@ -72,7 +72,7 @@ jobs:
7272
all|refcache)
7373
npm install --omit=optional
7474
;&
75-
dict|filenames|format|markdown|submodules)
75+
dict|filenames|format|markdown|submodule*)
7676
npm run fix:$PR_ACTION
7777
;;
7878
esac

package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"_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",
2424
"_fix:most": "npm run all -- $(npm -s run _list:fix:* | grep -Ev 'refcache|submodule')",
2525
"_get:no": "echo SKIPPING get operation",
26-
"_get:submodule:non-lang": "npm run _get:submodule -- content-modules/opentelemetry-specification themes/docsy",
2726
"_get:submodule": "set -x && git submodule update --init ${DEPTH:- --depth 999}",
2827
"_hugo": "hugo --cleanDestinationDir",
2928
"_install:dict": "npm install -D $(npm run -s _list:dict)",
@@ -32,7 +31,7 @@
3231
"_list:dict": "grep '^\\s*\"@cspell' package.json | awk -F: '{print $1}' | tr -d '\"'",
3332
"_list:fix:*": "npm run --loglevel=warn | grep -Ee '^\\s*fix:[^:]+$' | grep -v 'fix:all'",
3433
"_ls-bad-filenames": "find assets content static -name '*_*' ! -name '[_.]*'",
35-
"_pin": "scripts/pin-submodules.pl",
34+
"_pin:submodule": "scripts/pin-submodules.pl",
3635
"_prebuild": "npm run seq -- get:submodule cp:spec",
3736
"_prepare:docsy": "cd themes/docsy && npm install",
3837
"_prettier:any": "npx prettier --ignore-path ''",
@@ -71,7 +70,7 @@
7170
"fix:i18n": "npm run fix:i18n:new",
7271
"fix:markdown": "npm run check:markdown -- --fix",
7372
"fix:refcache": "npm run check:links",
74-
"fix:submodules": "npm run update:submodule && npm run _pin",
73+
"fix:submodule": "npm run pin:submodule",
7574
"fix:text": "npm run check:text -- --fix",
7675
"fix": "npm run fix:all",
7776
"format": "npm run _check:format -- --write && npm run _check:format:ja+zh -- --write",
@@ -81,13 +80,15 @@
8180
"make:public": "make public ls-public",
8281
"netlify-build:preview": "npm run seq -- build:preview diff:check",
8382
"netlify-build:production": "npm run seq -- build:production diff:check",
83+
"pin:submodule": "npm run _pin:submodule -- $PIN_SKIP",
84+
"postfix:submodule": "git submodule",
8485
"postget:submodule": "git submodule",
8586
"prebuild:preview": "npm run _prebuild",
8687
"prebuild:production": "npm run _prebuild",
8788
"prebuild": "npm run _prebuild",
8889
"precheck:links:internal": "npm run build && npm run update:htmltest-config",
8990
"precheck:links": "npm run build && npm run update:htmltest-config",
90-
"prefix:submodules": "npm run update:submodule",
91+
"prefix:submodule": "npm run update:submodule",
9192
"prepare": "npm run seq -- get:submodule _prepare:docsy",
9293
"preserve:hugo": "npm run _prebuild",
9394
"preserve:netlify": "npm run seq -- _prebuild _install:netlify-cli",
@@ -96,7 +97,7 @@
9697
"serve:hugo": "npm run _serve:hugo -- --renderToMemory",
9798
"serve:netlify": "npm run _serve:netlify",
9899
"serve": "npm run serve:hugo --",
99-
"test-and-fix": "npm run seq -- fix:submodules _fix:most test",
100+
"test-and-fix": "npm run seq -- fix:submodule _fix:most test",
100101
"test": "npm run check",
101102
"update:htmltest-config": "scripts/htmltest-config.sh",
102103
"update:pkg:hugo": "npm install --save-dev --save-exact hugo-extended@latest",

0 commit comments

Comments
 (0)