Skip to content

Commit 233146f

Browse files
committed
Update github actions
1 parent da233e1 commit 233146f

File tree

10 files changed

+154
-14
lines changed

10 files changed

+154
-14
lines changed

.github/workflows/settings-verification.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ jobs:
2323

2424
- name: Verify missing settings
2525
run: node scripts/verify-settings.js ${{ github.ref_name }}
26+
27+
- name: Verify missing commands
28+
run: node scripts/verify-commands.js ${{ github.ref_name }}

content/docs/commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: Commands
33
slug: commands
44
description: null
55
date: 2021-08-30T16:13:00.546Z
6-
lastmod: 2024-02-13T09:43:12.442Z
7-
weight: 900
6+
lastmod: 2024-02-26T17:54:13.589Z
7+
weight: 1100
88
---
99

1010
# Commands

content/docs/experimental/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: Experimental features
33
slug: experimental
44
description: Experimental features in the Front Matter extension.
55
date: 2023-02-12T14:39:58.691Z
6-
lastmod: 2023-08-21T08:13:43.748Z
7-
weight: 910
6+
lastmod: 2024-02-26T17:52:13.588Z
7+
weight: 900
88
---
99

1010
# Experimental features

content/docs/experimental/ui-extensibility.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: UI extensibility
33
slug: experimental/ui-extensibility
44
description: UI extensibility in the Front Matter extension.
55
date: 2023-04-01T10:16:59.392Z
6-
lastmod: 2023-08-21T09:23:29.241Z
7-
weight: 910.1
6+
lastmod: 2024-02-26T17:52:22.334Z
7+
weight: 900.1
88
---
99

1010
# UI extensibility

content/docs/settings/available-settings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: Settings overview
33
slug: settings/overview
44
description: null
55
date: 2023-02-13T16:44:09.618Z
6-
lastmod: 2024-02-24T13:16:18.482Z
7-
weight: 1100.2
6+
lastmod: 2024-02-26T17:54:04.814Z
7+
weight: 1000.2
88
---
99

1010
# Settings overview

content/docs/settings/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: Settings
33
slug: settings
44
description: null
55
date: 2021-08-30T16:13:00.546Z
6-
lastmod: 2024-02-13T08:44:01.601Z
7-
weight: 1100
6+
lastmod: 2024-02-26T17:53:54.854Z
7+
weight: 1000
88
---
99

1010
# Settings

content/docs/settings/projects.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: Projects
33
slug: settings/projects
44
description: Projects are useful when managing multiple sites or when you want to separate your content into different environments.
55
date: 2023-04-01T12:41:24.675Z
6-
lastmod: 2023-04-01T13:00:21.325Z
7-
weight: 1100.1
6+
lastmod: 2024-02-26T17:54:08.454Z
7+
weight: 1000.1
88
---
99

1010
# Projects

content/docs/troubleshooting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: Troubleshooting
33
slug: troubleshooting
44
description: null
55
date: 2021-12-21T09:53:30.176Z
6-
lastmod: 2023-03-25T20:24:17.797Z
7-
weight: 1000
6+
lastmod: 2024-02-26T17:53:05.362Z
7+
weight: 950
88
---
99

1010
# Troubleshooting

package-lock.json

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/verify-commands.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// @ts-check
2+
const fs = require("fs");
3+
const path = require("path");
4+
const fetch = require("node-fetch");
5+
const { exit } = require("process");
6+
const core = require("@actions/core");
7+
8+
(async () => {
9+
const branch = process.argv[process.argv.length - 1];
10+
const production = branch.toLowerCase() === "main";
11+
12+
console.log(`Checking commands for branch: ${branch}`);
13+
14+
const pkgUrl = `https://raw.githubusercontent.com/estruyf/vscode-front-matter/${
15+
production ? "main" : "dev"
16+
}/package.json`;
17+
18+
const response = await fetch(pkgUrl);
19+
if (!response.ok) {
20+
return;
21+
}
22+
23+
let contents = await response.text();
24+
25+
if (!contents) {
26+
console.log("No contents found");
27+
exit(1);
28+
}
29+
30+
const pkg = JSON.parse(contents);
31+
const commands = pkg.contributes.commands;
32+
const commandKeys = commands.map((c) => c.command);
33+
34+
const commandsPath = path.resolve(__dirname, "../content/docs/commands.md");
35+
const commandsFile = fs.readFileSync(commandsPath, "utf8");
36+
37+
const missingCommands = [];
38+
39+
for (const key of commandKeys) {
40+
if (!commandsFile.includes(key)) {
41+
missingCommands.push(key);
42+
}
43+
}
44+
45+
if (missingCommands.length > 0) {
46+
core.summary
47+
.addHeading(`Missing commands`)
48+
.addRaw(`\n ${missingCommands.map((s) => `- ${s}\n`).join("")}`)
49+
.write();
50+
51+
core.setFailed(`Missing settings: ${missingCommands.join(", ")}`);
52+
}
53+
})();

0 commit comments

Comments
 (0)