From 9623c7885765fc4bfbe23a1897268a5d94c33679 Mon Sep 17 00:00:00 2001 From: richarddushime Date: Thu, 28 Aug 2025 21:19:11 +0200 Subject: [PATCH 1/2] Fix GitHub Actions permissions for data-processing workflow - Fix git push authentication to resolve 403 permission errors --- .github/workflows/data-processing.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/data-processing.yml b/.github/workflows/data-processing.yml index e0b02342485..415ee1763ea 100644 --- a/.github/workflows/data-processing.yml +++ b/.github/workflows/data-processing.yml @@ -14,13 +14,15 @@ jobs: name: Process Data runs-on: ubuntu-22.04 permissions: - contents: read + contents: write pull-requests: write env: PYTHON_VERSION: "3.11" steps: - name: Checkout repository uses: actions/checkout@v4 + with: + token: ${{ secrets.STAGING_GITHUB_TOKEN }} - name: Set up Python uses: actions/setup-python@v5 @@ -151,9 +153,9 @@ jobs: echo "🔧 Manual trigger detected, creating PR for GA data update" fi - # Configure git - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" + # Configure git with proper authentication + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" # Create a new branch for the GA data update BRANCH_NAME="ga-data-update-$(date +%Y%m%d)" From de484d0a6f4e4027f861c77420f38023c4fd3fa2 Mon Sep 17 00:00:00 2001 From: richarddushime Date: Thu, 28 Aug 2025 21:23:00 +0200 Subject: [PATCH 2/2] gh token --- .github/workflows/data-processing.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/data-processing.yml b/.github/workflows/data-processing.yml index 415ee1763ea..934af229dd4 100644 --- a/.github/workflows/data-processing.yml +++ b/.github/workflows/data-processing.yml @@ -21,8 +21,11 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - with: - token: ${{ secrets.STAGING_GITHUB_TOKEN }} + + - name: Configure Git + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" - name: Set up Python uses: actions/setup-python@v5 @@ -153,10 +156,6 @@ jobs: echo "🔧 Manual trigger detected, creating PR for GA data update" fi - # Configure git with proper authentication - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - # Create a new branch for the GA data update BRANCH_NAME="ga-data-update-$(date +%Y%m%d)" echo "Creating branch: $BRANCH_NAME" @@ -185,8 +184,8 @@ jobs: echo "✅ PR created for GA data update" env: - GITHUB_TOKEN: ${{ secrets.STAGING_GITHUB_TOKEN }} - GH_TOKEN: ${{ secrets.STAGING_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ github.token }} - name: Run Google Scholar script continue-on-error: true # Continue even if this step fails