Skip to content

Commit d743ee0

Browse files
authored
Merge branch 'master' into nhussein11/follow-up-xcm-v5-guides
2 parents d191800 + 45017b5 commit d743ee0

File tree

88 files changed

+6350
-4898
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+6350
-4898
lines changed

.github/scripts/check_dependencies.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,29 @@ def get_latest_pypi_version(package_name):
5757
print(f"Error fetching PyPI package version for {package_name}: {e}")
5858
return None, None
5959

60+
def check_sub_dependencies(name, info, outdated_dependencies):
61+
"""Check sub-dependencies within a repository entry"""
62+
# Check if there's a subdependencies section
63+
subdependencies = info.get("subdependencies", {})
64+
65+
if not subdependencies:
66+
return
67+
68+
for key, current_version in subdependencies.items():
69+
if key.endswith("_version"):
70+
# Extract crate name from the key (remove _version suffix)
71+
crate_name = key.replace("_version", "").replace("_", "-")
72+
latest_version, latest_url = get_latest_crate_version(crate_name)
73+
74+
if latest_version and latest_version != current_version:
75+
outdated_dependencies.append({
76+
"name": f"{name}.{crate_name}",
77+
"category": "sub-dependency",
78+
"current_version": current_version,
79+
"latest_version": latest_version,
80+
"latest_release_url": latest_url,
81+
})
82+
6083
def check_releases(releases_source_file):
6184
try:
6285
with open(releases_source_file, "r") as file:
@@ -88,6 +111,10 @@ def check_releases(releases_source_file):
88111
"latest_version": latest_version,
89112
"latest_release_url": latest_url,
90113
})
114+
115+
# Check sub-dependencies for repositories
116+
if category == "repositories":
117+
check_sub_dependencies(name, info, outdated_dependencies)
91118

92119
return outdated_dependencies
93120

.github/workflows/check-llms.yml

Lines changed: 7 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2,66 +2,12 @@ name: Validate llms.txt
22

33
on:
44
pull_request:
5-
branches:
6-
- master
5+
branches: [master]
76

87
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
8+
validate:
9+
uses: papermoonio/workflows/.github/workflows/validate-llms.yml@main
10+
with:
11+
llms_filename: "llms.txt"
12+
generator_command: "python3 scripts/generate_llms.py"
13+
require_pr_file: false

0 commit comments

Comments
 (0)