handle forks

# What does this PR do?


## Test Plan
This commit is contained in:
Eric Huang 2025-08-01 15:26:30 -07:00
parent 204c2717ce
commit cc3c042fb7

View file

@ -173,11 +173,23 @@ runs:
git commit -m "Recordings update from CI"
fi
git fetch origin ${{ github.event.pull_request.head.ref }}
git rebase origin/${{ github.event.pull_request.head.ref }}
echo "Rebased successfully"
git push origin HEAD:${{ github.event.pull_request.head.ref }}
echo "Pushed successfully"
# Handle both fork PRs and regular PRs
if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then
echo "Fork PR detected from ${{ github.event.pull_request.head.repo.full_name }}"
echo "📦 Updated recordings are available as workflow artifacts"
echo ""
echo "To update your PR:"
echo "1. Download the 'updated-recordings' artifact from this workflow run"
echo "2. Extract the ZIP file"
echo "3. Replace tests/integration/recordings/ in your fork with the extracted files"
echo "4. Commit and push: git add tests/integration/recordings/ && git commit -m 'Update recordings' && git push"
else
git fetch origin ${{ github.event.pull_request.head.ref }}
git rebase origin/${{ github.event.pull_request.head.ref }}
echo "Rebased successfully"
git push origin HEAD:${{ github.event.pull_request.head.ref }}
echo "Pushed successfully"
fi
else
echo "No recording changes"
fi
@ -188,6 +200,14 @@ runs:
run: |
sudo docker logs ollama > ollama-${{ inputs.inference-mode }}.log || true
- name: Upload recordings (for fork PRs)
if: ${{ inputs.inference-mode == 'record' && github.event.pull_request.head.repo.full_name != github.repository }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: updated-recordings-${{ github.run_id }}-${{ github.run_attempt || '' }}-${{ strategy.job-index }}
path: tests/integration/recordings/
retention-days: 7
- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2