Compare commits

..

No commits in common. "6e0e3675699ade0ef42f708f055a21e5717df007" and "9982c682c3bfd962b508ebddd6dc0a17d178731a" have entirely different histories.

3 changed files with 0 additions and 72 deletions

View File

@ -1,29 +0,0 @@
name: Auto-update README
on:
push:
branches: [main]
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Клонировать репозиторий
uses: actions/checkout@v4
with:
token: ${{ secrets.ACTIONS_TOKEN }}
- name: Запустить Python-скрипт
run: python3 scripts/update_readme.py
- name: Закоммитить изменения, если есть
run: |
git config user.name "README Bot"
git config user.email "bot@example.com"
if git diff --quiet README.md; then
echo "Изменений нет"
else
git add README.md
git commit -m "Автообновление README [skip ci]"
git push
fi

View File

@ -2,8 +2,6 @@
Проект сайта-портфолио программиста.
<!-- BEGIN_STRUCTURE -->
## Функциональность
- Компетенции и решения
- Отзывы клиентов
@ -17,5 +15,3 @@ pip install -r requirements.txt
python manage.py migrate
python manage.py collectstatic
python manage.py createsuperuser
<!-- END_STRUCTURE -->

View File

@ -1,39 +0,0 @@
#!/usr/bin/env python3
import os
import re
README_PATH = "README.md"
START_MARKER = "<!-- BEGIN_STRUCTURE -->"
END_MARKER = "<!-- END_STRUCTURE -->"
def generate_structure():
"""Создаёт список файлов и папок в корне репозитория."""
items = []
for name in sorted(os.listdir(".")):
if name.startswith('.') or name == 'scripts':
continue
icon = "📁" if os.path.isdir(name) else "📄"
items.append(f"- {icon} {name}")
return "\n".join(items)
def update_readme():
with open(README_PATH, "r", encoding="utf-8") as f:
content = f.read()
new_block = generate_structure()
pattern = re.compile(
re.escape(START_MARKER) + r".*?" + re.escape(END_MARKER),
re.DOTALL
)
replacement = START_MARKER + "\n" + new_block + "\n" + END_MARKER
if pattern.search(content):
new_content = pattern.sub(replacement, content)
else:
new_content = content.strip() + "\n\n" + replacement + "\n"
with open(README_PATH, "w", encoding="utf-8") as f:
f.write(new_content)
if __name__ == "__main__":
update_readme()