diff --git a/.github/workflows/update-md-date.yml b/.github/workflows/update-md-date.yml index afa6680..5b2a19b 100644 --- a/.github/workflows/update-md-date.yml +++ b/.github/workflows/update-md-date.yml @@ -5,15 +5,20 @@ on: branches: - main +permissions: + contents: write + pull-requests: write + jobs: update-date: runs-on: ubuntu-latest steps: - - name: Checkout repository + - name: Checkout PR branch uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ github.event.pull_request.head.ref }} - name: Set up Python uses: actions/setup-python@v4 @@ -27,17 +32,17 @@ jobs: run: | git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" - + - name: Update last modified date in Markdown files run: python .github/workflows/update_date.py - - name: Commit changes + - name: Pull (merge) remote changes, commit, and push if needed env: TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - git fetch origin - git pull --rebase origin ${{ github.event.pull_request.head.ref }} || echo "No rebase needed" + BRANCH="${{ github.event.pull_request.head.ref }}" + git pull origin "$BRANCH" || echo "No merge needed" git add -A git commit -m "Update last modified date in Markdown files" || echo "No changes to commit" git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }} - git push origin HEAD:${{ github.event.pull_request.head.ref }} + git push origin HEAD:"$BRANCH" diff --git a/BestPractices.md b/BestPractices.md index acc46d2..ad03904 100644 --- a/BestPractices.md +++ b/BestPractices.md @@ -96,8 +96,8 @@ Last updated: 2025-08-04
Refresh Date: 2025-08-27
+Refresh Date: 2025-08-29
Refresh Date: 2025-08-27
+Refresh Date: 2025-08-29
Refresh Date: 2025-08-27
+Refresh Date: 2025-08-29
Refresh Date: 2025-08-27
+Refresh Date: 2025-08-29
Refresh Date: 2025-08-27
+Refresh Date: 2025-08-29