From 27435f4a078bb159e0ebdee2fe22f2fa561b30bf Mon Sep 17 00:00:00 2001 From: MCAHITK-MINOR-PROJECT Date: Fri, 25 Oct 2024 19:59:18 +0530 Subject: [PATCH] Update update_leaderboard.yml --- .github/workflows/update_leaderboard.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update_leaderboard.yml b/.github/workflows/update_leaderboard.yml index 33a178b..f7b6053 100644 --- a/.github/workflows/update_leaderboard.yml +++ b/.github/workflows/update_leaderboard.yml @@ -9,25 +9,29 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout repository uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.x' - + - name: Install dependencies run: | python -m pip install --upgrade pip pip install requests PyGithub - + - name: Run leaderboard update script run: | python .github/scripts/update_leaderboard.py env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token - GITHUB_REPOSITORY: ${{ github.repository }} # Repository info + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Pass GitHub token to script + GITHUB_REPOSITORY: ${{ github.repository }} # Pass repository information - name: Commit and push changes run: | @@ -35,4 +39,4 @@ jobs: git config --global user.email "github-actions[bot]@users.noreply.github.com" git add leaderboard.md || echo "No changes to commit" # Prevent errors if there's nothing to commit git commit -m "Update leaderboard" || echo "No changes to commit" - git push || echo "Nothing to push" + git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} || echo "Nothing to push"