Skip to content

Commit 5cc0fd6

Browse files
authored
Adds LLMS Flow (#368)
* llms flow * llms * yaml install * install requests * llms
1 parent 28c601c commit 5cc0fd6

File tree

4 files changed

+27763
-1
lines changed

4 files changed

+27763
-1
lines changed

.github/workflows/check-llms.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Validate llms.txt
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
check-llms:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.x'
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install pyyaml requests
25+
26+
- name: Get SHA256 hash of the PR's llms.txt file
27+
id: pr_llms_hash
28+
run: |
29+
if [ -f "llms.txt" ]; then
30+
# Calculate SHA256 hash of the llms.txt file in the PR branch (checked out by default)
31+
sha256sum llms.txt | awk '{ print $1 }' > pr_sha256.txt
32+
else
33+
echo "0000" > pr_sha256.txt
34+
fi
35+
cat pr_sha256.txt
36+
37+
- name: Generate llms.txt using the Python script
38+
run: python3 scripts/generate_llms.py
39+
40+
- name: Calculate SHA256 hash of the generated llms.txt
41+
id: generated_llms_hash
42+
run: |
43+
# Full path to the generated llms.txt file
44+
llms_file="/home/runner/work/polkadot-docs/polkadot-docs/llms.txt"
45+
46+
# Check if the file exists before calculating the hash
47+
if [ -f "$llms_file" ]; then
48+
sha256sum "$llms_file" | awk '{ print $1 }' > generated_sha256.txt
49+
else
50+
echo "Error: llms.txt not found at $llms_file"
51+
exit 1
52+
fi
53+
cat generated_sha256.txt
54+
55+
- name: Compare the SHA256 hashes
56+
run: |
57+
generated_hash=$(cat generated_sha256.txt)
58+
pr_hash=$(cat pr_sha256.txt)
59+
60+
if [ "$generated_hash" != "$pr_hash" ]; then
61+
echo "Error: SHA256 hashes do not match. The generated llms.txt file differs from the one in the PR."
62+
echo "You need to run the generate LLMS script:"
63+
echo "python3 scripts/generate_llms.py"
64+
exit 1
65+
else
66+
echo "SHA256 hashes match. The llms.txt file is consistent."
67+
fi

infrastructure/running-a-validator/onboarding-and-offboarding/set-up-validator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ Once the Polkadot binaries are installed, it's essential to verify that everythi
206206

207207
The output should show the version numbers for each of the binaries. Ensure that the versions match and are consistent, similar to the following example (the specific version may vary):
208208

209-
--8<-- 'code/infrastructure/running-a-validator/onboarding-and-offboarding/requirements/terminal-output-01.html'
209+
--8<-- 'code/infrastructure/running-a-validator/onboarding-and-offboarding/set-up-a-validator/terminal-output-01.html'
210210

211211
If the versions do not match or if there is an error, double-check that all the binaries were correctly installed and are accessible within your `$PATH`.
212212

0 commit comments

Comments
 (0)