Skip to content

Parse Markdown and Generate JSON #410

Parse Markdown and Generate JSON

Parse Markdown and Generate JSON #410

name: Parse Markdown and Generate JSON
on:
schedule:
- cron: '0 0 * * *' # 00:00 UTC
workflow_dispatch:
jobs:
parse_markdown:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.10.11
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install bs4 markdown2 prettytable PyGithub flake8
- name: Run Flake8 (Linting)
run: flake8 code/
- name: Run Markdown Parser
id: parse
run: python code/markdown_to_json_parser.py
working-directory: ${{ github.workspace }}
continue-on-error: true
env:
PAPER_TOKEN: ${{ secrets.PAPER_TOKEN }}
- name: Upload JSON files
uses: actions/upload-artifact@v4
with:
name: json_data
path: ${{ github.workspace }}/json_data
- name: Set output status
if: steps.parse.outcome == 'success'
run: echo "status=success" >> $GITHUB_ENV
- name: Set output status (failure)
if: steps.parse.outcome == 'failure'
run: echo "status=failure" >> $GITHUB_ENV