diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index db6fe406..36b197d6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -33,16 +33,14 @@ jobs: env: GITHUB_REF: ${{ github.head_ref || github.ref }} steps: - - name: Git config - run: | - git config --global user.name "UltralyticsAssistant" - git config --global user.email "web@ultralytics.com" - name: Checkout Repository uses: actions/checkout@v4 with: + # Depth 0 required for publishing to capture full author history repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} token: ${{ secrets._GITHUB_TOKEN || secrets.GITHUB_TOKEN }} ref: ${{ env.GITHUB_REF }} + depth: ${{ github.event_name == 'push' && 0 || 1 }} - name: Set up Python uses: actions/setup-python@v5 with: @@ -56,6 +54,8 @@ jobs: - name: Update Docs Reference Section and Push Changes continue-on-error: true run: | + git config --global user.name "UltralyticsAssistant" + git config --global user.email "web@ultralytics.com" python docs/build_reference.py git pull origin "$GITHUB_REF" git add .