Skip to content

Commit bf6547f

Browse files
committed
ci: fix slug-map creation
1 parent 936bd9f commit bf6547f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/workflows/update-devdocs.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,14 @@ jobs:
3333
# GUARD if only the `info.plist` was updated, it's due to formatting changes
3434
# and there is not actual update to be made.
3535
updated_files=$(git diff --name-only)
36-
[[ ! "$updated_files" =~ keyword-slug-map ]] && exit 0
36+
if ! echo "$updated_files" | grep -q "devdocs-keyword-slug-map"; then
37+
echo "No changes to commit."
38+
exit 0
39+
fi
3740
3841
# determine what changes occurred and add them to the commit message
3942
changes=$(
40-
git diff .github/keyword-slug-map.json |
43+
git diff **/devdocs-keyword-slug-map.json |
4144
tail +6 | # remove diff header
4245
grep "^+" | # only added lines
4346
cut -d'"' -f4 | # only changed value

scripts/devdocs/update-devdocs.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ async function run() {
9090
// keyword-slug-map
9191
if (!fs.existsSync("./.github/caches/")) fs.mkdirSync("./.github/caches/", { recursive: true });
9292
const beautifiedForBetterDiff = JSON.stringify(allLangs, null, 2);
93-
fs.writeFileSync("./.github/caches/keyword-slug-map.json", beautifiedForBetterDiff);
93+
fs.writeFileSync("./.github/caches/devdocs-keyword-slug-map.json", beautifiedForBetterDiff);
9494

9595
// info.plist: update to insert all languages as options
9696
/** @type {string[]} */

0 commit comments

Comments
 (0)