Skip to content
Latchkey

Parse Markdown and Generate JSON workflow (DmitryRyumin/ICCV-2023-25-Papers)

The Parse Markdown and Generate JSON workflow from DmitryRyumin/ICCV-2023-25-Papers, explained and optimized by Latchkey.

C

CI health: C - fair

Point runs-on at Latchkey and get caching, job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: DmitryRyumin/ICCV-2023-25-Papers.github/workflows/parse_markdown.ymlLicense MITView source

What it does

This is the Parse Markdown and Generate JSON workflow from the DmitryRyumin/ICCV-2023-25-Papers repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
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 black
        continue-on-error: true

      - name: Run Flake8 (Linting)
        run: flake8 code/

      - name: Check code formatting
        run: black --check 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
        run: echo "status=${{ steps.parse.outcome }}" >> $GITHUB_ENV

The same workflow, on Latchkey

Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.

name: Parse Markdown and Generate JSON
 
on:
  schedule:
    - cron: '0 0 * * *' # 00:00 UTC
  workflow_dispatch:
 
jobs:
  parse_markdown:
    timeout-minutes: 30
    runs-on: latchkey-small
 
    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:
          cache: 'npm'
          node-version: '20'
 
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install bs4 markdown2 prettytable PyGithub flake8 black
        continue-on-error: true
 
      - name: Run Flake8 (Linting)
        run: flake8 code/
 
      - name: Check code formatting
        run: black --check 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
        run: echo "status=${{ steps.parse.outcome }}" >> $GITHUB_ENV
 

What changed

What Latchkey heals here

This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow