Skip to content

Commit

Permalink
[CI] Add PR action for refcache refresh and refresh some entries (#5886)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin authored Jan 6, 2025
1 parent ca171b7 commit b68e228
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 550 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/pr-actions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: PR actions
# cSpell:ignore esac htmltest refcache nvmrc

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

- run: |
case $PR_ACTION in
all|refcache|text)
all|refcache*|text)
npm install --omit=optional
;&
*)
Expand Down
2 changes: 1 addition & 1 deletion gulp-src/prune.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ async function pruneTask() {
return;
} else if (n == 0) {
console.log(
`WARN: num is ${n} so no entries will be pruned by date. Specify number of entries to prune as --num <n>.`,
`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`,
);
if (numEntriesWith4xxStatus == 0) return;
}
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"_prebuild": "npm run seq -- get:submodule cp:spec",
"_prepare:docsy": "cd themes/docsy && npm install",
"_prettier:any": "npx prettier --ignore-path ''",
"_refcache:prune": "npx gulp prune",
"_rename-to-kebab-case": "find assets content static -name '*_*' ! -name '[_.]*' -exec sh -c 'mv \"$1\" \"${1//_/-}\"' _ {} \\;",
"_serve:hugo": "hugo server --buildDrafts --minify",
"_serve:netlify": "netlify dev -c \"npm run _serve:hugo -- --renderToMemory\"",
Expand Down Expand Up @@ -75,6 +76,7 @@
"fix:i18n": "npm run fix:i18n:new",
"fix:markdown": "npm run check:markdown -- --fix",
"fix:refcache": "npm run check:links",
"fix:refcache:fresh": "npm run _refcache:prune -- -n ${PRUNE_N:-128}",
"fix:submodule": "npm run pin:submodule",
"fix:text": "npm run check:text -- --fix",
"fix": "npm run fix:all",
Expand All @@ -86,6 +88,7 @@
"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:refcache:fresh": "npm run fix:refcache",
"postfix:submodule": "git submodule",
"postget:submodule": "git submodule",
"prebuild:preview": "npm run _prebuild",
Expand Down
Loading

0 comments on commit b68e228

Please sign in to comment.