.github/workflows/udemy.yml #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 1 * *' | |
jobs: | |
generate_badge: | |
runs-on: ubuntu-latest | |
name: badge_generation | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Badge generation | |
uses: Clement-Jean/udemy-badge-generator@v1 | |
env: | |
UDEMY_TOKEN: ${{ secrets.UDEMY_TOKEN }} | |
UDEMY_COURSE: ${{ secrets.UDEMY_COURSE }} | |
- name: Commit the badge (if it changed) | |
run: | | |
if [[ `git status --porcelain` ]]; then | |
git config --global user.name 'Clement Jean' | |
git config --global user.email 'Clement-Jean@users.noreply.github.com' | |
git add .github/badges/udemy.svg | |
git commit -m "Autogenerated Udemy rating badge" | |
git push | |
fi |