Merge pull request #44 from Sammybams/main #44
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
name: Update Leaderboard | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: {} # Add workflow dispatch for manual triggering | |
jobs: | |
update-leaderboard-and-resize-images: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11.5 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests==2.31.0 | |
- name: Configure Git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "mlsanigeria" | |
- name: Pass Environment Variables and Run Script | |
env: | |
API_TOKEN: ${{ secrets.API_TOKEN }} | |
run: | | |
# Pass the API_TOKEN secret as an environment variable to your script | |
python update_leaderboard.py | |
- name: Check for changes | |
id: check_changes | |
run: | | |
git diff --exit-code || echo "::set-output name=changes::true" | |
- name: Commit and Push Changes | |
if: steps.check_changes.outputs.changes == 'true' | |
run: | | |
git pull | |
git add . | |
git commit -m "Updated leaderboard" | |
git remote set-url origin https://[email protected]/mlsanigeria/speak-to-docs.git | |
git push |