Skip to content

Upload document.html for conversion #6

Upload document.html for conversion

Upload document.html for conversion #6

Workflow file for this run

name: Convert Files to Markdown
on:
push:
paths:
- 'uploads/**'
workflow_dispatch:
jobs:
convert:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install markitdown
- name: Convert files
run: |
mkdir -p docs/converted
for file in uploads/*; do
if [ -f "$file" ]; then
filename=$(basename "$file")
output_file="docs/converted/${filename%.*}.md"
echo "Converting $filename to Markdown..."
markitdown "$file" -o "$output_file" || echo "Failed to convert $filename"
fi
done
- name: Commit converted files
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add docs/converted/
git commit -m "Convert files to Markdown" || echo "No changes to commit"
git push