Skip to content

Update generate_markdown_list.yml #3

Update generate_markdown_list.yml

Update generate_markdown_list.yml #3

name: Generate Markdown List
on:
push:
branches:
- main # Cambia a la rama que prefieras
jobs:
generate-list:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyyaml pandas
- name: Generate markdown files list
run: |
echo "
import os

Check failure on line 29 in .github/workflows/generate_markdown_list.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/generate_markdown_list.yml

Invalid workflow file

You have an error in your yaml syntax on line 29
import yaml
import json
import pandas as pd
repo_path = '.'
markdown_files = []
for root, dirs, files in os.walk(repo_path):
for file in files:
if file.endswith('.md'):
full_path = os.path.join(root, file)
relative_path = os.path.relpath(full_path, repo_path)
markdown_files.append(relative_path)
with open('markdown_files.yaml', 'w') as yaml_file:
yaml.dump(markdown_files, yaml_file)
with open('markdown_files.json', 'w') as json_file:
json.dump(markdown_files, json_file, indent=4)
df = pd.DataFrame(markdown_files, columns=['Path'])
df.to_csv('markdown_files.csv', index=False)
" > script.py
python script.py
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add markdown_files.yaml markdown_files.json markdown_files.csv
git commit -m 'Generate markdown files list'
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}