Skip to content

Commit b68e228

Browse files
authored
[CI] Add PR action for refcache refresh and refresh some entries (#5886)
1 parent ca171b7 commit b68e228

File tree

4 files changed

+194
-550
lines changed

4 files changed

+194
-550
lines changed

.github/workflows/pr-actions.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: PR actions
2+
# cSpell:ignore esac htmltest refcache nvmrc
23

34
on:
45
issue_comment:
@@ -29,9 +30,9 @@ jobs:
2930
- name: Extract action name
3031
id: extract_action_name
3132
run: |
32-
PR_ACTION=$(echo $COMMENT | grep -oP '/fix:\K[-_0-9a-z]+')
33+
PR_ACTION=$(echo $COMMENT | grep -oP '/fix:\K[:-_0-9a-z]+')
3334
echo "Action is $PR_ACTION"
34-
ACTION_NAMES="all|dict|expired|filenames|format|htmltest-config|i18n|markdown|refcache|submodules?|text"
35+
ACTION_NAMES="all|dict|expired|filenames|format|htmltest-config|i18n|markdown|refcache(:refresh)?|submodules?|text"
3536
if [[ ! "$PR_ACTION" =~ ^($ACTION_NAMES)$ ]]; then
3637
echo "Invalid action name: $PR_ACTION"
3738
echo "Action name should be one of: $ACTION_NAMES"
@@ -69,7 +70,7 @@ jobs:
6970

7071
- run: |
7172
case $PR_ACTION in
72-
all|refcache|text)
73+
all|refcache*|text)
7374
npm install --omit=optional
7475
;&
7576
*)

gulp-src/prune.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ async function pruneTask() {
114114
return;
115115
} else if (n == 0) {
116116
console.log(
117-
`WARN: num is ${n} so no entries will be pruned by date. Specify number of entries to prune as --num <n>.`,
117+
`WARN: num is ${n} so no entries will be pruned by date. Specify number of entries to prune as --num <n>. For more info use --info`,
118118
);
119119
if (numEntriesWith4xxStatus == 0) return;
120120
}

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"_prebuild": "npm run seq -- get:submodule cp:spec",
3838
"_prepare:docsy": "cd themes/docsy && npm install",
3939
"_prettier:any": "npx prettier --ignore-path ''",
40+
"_refcache:prune": "npx gulp prune",
4041
"_rename-to-kebab-case": "find assets content static -name '*_*' ! -name '[_.]*' -exec sh -c 'mv \"$1\" \"${1//_/-}\"' _ {} \\;",
4142
"_serve:hugo": "hugo server --buildDrafts --minify",
4243
"_serve:netlify": "netlify dev -c \"npm run _serve:hugo -- --renderToMemory\"",
@@ -75,6 +76,7 @@
7576
"fix:i18n": "npm run fix:i18n:new",
7677
"fix:markdown": "npm run check:markdown -- --fix",
7778
"fix:refcache": "npm run check:links",
79+
"fix:refcache:fresh": "npm run _refcache:prune -- -n ${PRUNE_N:-128}",
7880
"fix:submodule": "npm run pin:submodule",
7981
"fix:text": "npm run check:text -- --fix",
8082
"fix": "npm run fix:all",
@@ -86,6 +88,7 @@
8688
"netlify-build:preview": "npm run seq -- build:preview diff:check",
8789
"netlify-build:production": "npm run seq -- build:production diff:check",
8890
"pin:submodule": "npm run _pin:submodule -- $PIN_SKIP",
91+
"postfix:refcache:fresh": "npm run fix:refcache",
8992
"postfix:submodule": "git submodule",
9093
"postget:submodule": "git submodule",
9194
"prebuild:preview": "npm run _prebuild",

0 commit comments

Comments
 (0)