Skip to content

GitHub Actions workflow that update your progress on Duolingo

License

Notifications You must be signed in to change notification settings

Craftermath/duolingo-to-markdown

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Repository files navigation

duolingo-to-markdown

cover

📚Update your duolingo progress to your github README profile.

Example Output

Duolingo username: Caoticarol
Last Streak: 263

LanguageExperience
Japanese 18442
German 5596
Spanish 2769

SETUP

  • A README.md file.
  • Duolingo Account.
  • Set up a GitHub Secret called DUOLINGO_USERNAME with your Duolingo username.
  • Add a <!-- duolingo --> tag in your README.md file, with three blank lines below it. The Duolingo progress will be placed here.

Instructions

To use this release, add a duolingo-to-markdown.yml workflow file to the .github/workflows folder in your repository with the following code:

name: duolingo-to-markdown

on:
  schedule:
    - cron: '1 1 * * *'
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: repo checkout
        uses: actions/checkout@v4
        with:
          persist-credentials: false

      - name: python setup
        uses: actions/setup-python@v4
        with:
          python-version: '3.x'

      - name: python packages installation
        run: |
          python -m pip install --upgrade pip
          pip install -r requests beautifulsoup

      - name: duolingo to markdown with fstrings
        env:
          DUOLINGO_USERNAME: ${{ secrets.DUOLINGO_USERNAME }}
          DUOLINGO_LANGUAGE_LENGTH: 3 # Optional. Defaults to 2. Language you want to show (are sort of higher experience to lower).
        run: python .github/scripts/duolingo-to-markdown.py

      - name: commit changes
        continue-on-error: true
        run: |
          git config --local user.email "[email protected]"
          git config --local user.name "GitHub Action"
          git add -A
          git commit -m "Updated duolingo-to-markdown daily progress" -a

      - name: push changes
        continue-on-error: true
        uses: ad-m/[email protected]
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}\
          branch: main

The cron job is scheduled to run once a day, but you can do it weekly changing - cron: '1 1 * * *' . You can manually run the workflow to test the code, going to the Actions tab in your repository.

About:

This is a copy with slighty modifications from the original work here.

About

GitHub Actions workflow that update your progress on Duolingo

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%