Skip to content

Commit 7ac9d89

Browse files
committed
add titles
1 parent e693c72 commit 7ac9d89

15 files changed

+141
-10
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Check Markdown Frontmatter
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.md'
7+
pull_request:
8+
paths:
9+
- '**.md'
10+
11+
jobs:
12+
check-frontmatter:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '16'
23+
24+
- name: Install dependencies
25+
run: |
26+
npm init -y
27+
npm install gray-matter
28+
29+
- name: Check frontmatter
30+
run: |
31+
node -e '
32+
const fs = require("fs");
33+
const matter = require("gray-matter");
34+
const path = require("path");
35+
36+
function getAllMarkdownFiles(dir) {
37+
let results = [];
38+
const files = fs.readdirSync(dir);
39+
40+
for (const file of files) {
41+
const filePath = path.join(dir, file);
42+
const stat = fs.statSync(filePath);
43+
44+
if (stat.isDirectory() && !file.startsWith(".")) {
45+
results = results.concat(getAllMarkdownFiles(filePath));
46+
} else if (file.endsWith(".md")) {
47+
results.push(filePath);
48+
}
49+
}
50+
51+
return results;
52+
}
53+
54+
let hasError = false;
55+
const mdFiles = getAllMarkdownFiles(".");
56+
57+
for (const file of mdFiles) {
58+
try {
59+
const content = fs.readFileSync(file, "utf8");
60+
const { data } = matter(content);
61+
62+
if (!data.title) {
63+
console.error(`Error: ${file} is missing title in frontmatter`);
64+
hasError = true;
65+
}
66+
} catch (error) {
67+
console.error(`Error processing ${file}: ${error.message}`);
68+
hasError = true;
69+
}
70+
}
71+
72+
if (hasError) {
73+
process.exit(1);
74+
}
75+
'

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
title: CHAINS Research Project at KTH
3+
---
4+
15
```
26
.d8888b. 888 888 d8888 8888888 888b 888 .d8888b.
37
d88P Y88b 888 888 d88888 888 8888b 888 d88P Y88b

dependency-resolution/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Dependency Resolution in Different Ecosystems
1+
---
2+
title: Dependency Resolution Algorithms in Different Ecosystems
3+
---
4+
5+
# Dependency Resolution Algorithms in Different Ecosystems
26

37
The post discusses how different package managers resolve dependencies while for building.
48

kick-off.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# [CHAINS project](https://github.com/chains-project) kick-off
1+
---
2+
title: Chains kickoff agenda
3+
---
4+
5+
# Chains kickoff agenda
26

37
September 30, 2022. Full day about software research for hardening the [software supply chain](https://ieeexplore.ieee.org/iel7/8013/9740698/09740718.pdf?casa_token=KSf4UwB5iDgAAAAA:7zZF3diR334b4239kTfgmFXBWnQNNApbJ4SM42QUjsW6oi11-Rtxw8WjL4NPOc7Ae2oxiPOkHUA).
48

master-thesis.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
title: Open Master Thesis Topics in Project Chains
3+
---
4+
15
# Master Thesis Topics in Project Chains
26

37
Project Chains hosts master's students for their theses, here are available topics. See [main page](/) for completed theses.

nixcon-2022.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# NixCon 2022: A Brief Summary
1+
---
2+
title: A Brief Software Supply Chain Summary of NixCon 2022
3+
---
4+
5+
6+
# A Brief Software Supply Chain Summary of NixCon 2022
27

38
[NixCon](https://2022.nixcon.org/), the yearly convention for all things Nix was
49
held in Paris this year. I attended as a member of the [Consistent Hardening and

recommendations-chains.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# The CHAINS software supply chain recommendations
1+
---
2+
title: The official CHAINS software supply chain recommendations
3+
---
4+
5+
6+
# The official CHAINS software supply chain recommendations
27

38
Based on our readings and research, we came to the following conclusions.
49

reproducible-builds-2023/index.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# Reproducible Builds Summit 2023
1+
---
2+
title: A Brief Software Supply Chain Summary Reproducible Builds Summit 2023
3+
---
4+
5+
6+
# A Brief Software Supply Chain Summary Reproducible Builds Summit 2023
27

38
Reproducible Builds 2023 was held in Hamburg, Germany this year.
49
Aman Sharma from Chains attended the summit to understand the state-of-the-art in reproducible

sbom-github.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
title: Adding SBOMs to your GitHub and Maven Central Releases with Jreleaser
3+
---
4+
5+
16
# Adding SBOMs to your GitHub and Maven Central Releases with Jreleaser
27

38
## Motivation

software-supply-chain-art.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Software supply chains inspires art
1+
---
2+
title: Software supply chains inspired art
3+
---
4+
5+
# Software supply chains inspired art
26

37
[CHAINS](https://chains-project.github.io/) explores the depths of software supply chains of Java and JavaScript projects to map and contribute to the state of the art of software hardening. Through these explorations we develop tools, collect data and execute software. These novel insights about the sublimity of the software supply chain inspire artists and developers who operate in the area of software art.
48

0 commit comments

Comments
 (0)