[skip-ci]docs: add forward docstring to unet #4174
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Auto Code Review | |
| on: | |
| pull_request: | |
| issue_comment: | |
| types: [created] | |
| push: | |
| branches: | |
| - '**' | |
| env: | |
| GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
| GOOGLE_MODEL_ID: ${{ vars.GOOGLE_MODEL_ID }} | |
| jobs: | |
| auto-review: | |
| runs-on: ubuntu-latest-rbln | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 2 | |
| - name: Check if review should run | |
| id: check | |
| run: | | |
| PR_NUMBER="" | |
| SHOULD_RUN="false" | |
| # For push events, check commit message | |
| if [[ "${{ github.event_name }}" == "push" ]]; then | |
| if [[ "${{ contains(github.event.head_commit.message, '[autoreview]') }}" == "true" ]]; then | |
| SHOULD_RUN="true" | |
| # Use GitHub CLI to find PR associated with this commit | |
| PR_NUMBER=$(gh pr list --head ${{ github.ref_name }} --json number --jq '.[0].number') | |
| fi | |
| # For PR events | |
| elif [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| PR_NUMBER="${{ github.event.pull_request.number }}" | |
| # For comment events, check if it's "/autoreview" | |
| elif [[ "${{ github.event_name }}" == "issue_comment" ]]; then | |
| if [[ "${{ github.event.issue.pull_request != null }}" == "true" && "${{ contains(github.event.comment.body, '/autoreview') }}" == "true" ]]; then | |
| SHOULD_RUN="true" | |
| PR_NUMBER="${{ github.event.issue.number }}" | |
| fi | |
| fi | |
| echo "should_run=$SHOULD_RUN" >> $GITHUB_OUTPUT | |
| echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Python | |
| if: steps.check.outputs.should_run == 'true' && steps.check.outputs.pr_number != '' | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| if: steps.check.outputs.should_run == 'true' && steps.check.outputs.pr_number != '' | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install google-generativeai PyGithub | |
| - name: Run Auto Code Review | |
| if: steps.check.outputs.should_run == 'true' && steps.check.outputs.pr_number != '' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PR_NUMBER: ${{ steps.check.outputs.pr_number }} | |
| run: python .github/scripts/auto_code_review.py |