Skip to content

Commit

Permalink
Merge pull request #4
Browse files Browse the repository at this point in the history
* extend readme with a special case

* Merge remote-tracking branch 'origin/main'

* update readme

* update readme

* Merge remote-tracking branch 'origin/main' into DEV2-7120-update-readme

* update readme
  • Loading branch information
igor-klymenok authored Aug 7, 2024
1 parent e4a1294 commit 44fd8be
Showing 1 changed file with 7 additions and 53 deletions.
60 changes: 7 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ with:

# The source branch of the pull request
ref: origin/${{ github.head_ref }}

# The target branch (destination) of the pull request
base_ref: origin/${{ github.base_ref }}

# Path to the repository in the workflow run, typically equal to "github.workspace"
path_to_repo: ${{ github.workspace }}
Expand All @@ -43,42 +46,7 @@ with:
Full workflow that is triggered on "pull_request":
```yaml
name: "Review PR"

on:
pull_request:
branches:
- main

jobs:
review_pr:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Analyse PR
uses: codota/tabnine-pr-agent@main
continue-on-error: true
with:
PAT: ${{ secrets.COACHING_PAT }}
ref: origin/${{ github.head_ref }}
path_to_repo: ${{ github.workspace }}
repository_owner: ${{ github.repository_owner }}
repository_name: ${{ github.event.repository.name }}
pull_request_id: ${{ github.event.pull_request.number }}
github_token: ${{ secrets.GITHUB_TOKEN }}
```
### Special case: inviting someone outside Tabnine organisation
To invite an external user, you'll need to provide them with a couple of essential items:
1. A specially created "Deploy key", which is a read-only SSH key. This can be individually created for each invitee or for a group of people, depending on your preference.
2. An advanced workflow configuration, which you can directly copy and paste from below:
```yaml
name: "Review PR"
name: "Tabnine PR review agent"

on:
pull_request:
Expand All @@ -94,30 +62,16 @@ jobs:
with:
fetch-depth: 0

- name: Checkout the action repository
uses: actions/checkout@v4
with:
repository: codota/tabnine-pr-agent
ref: v1
path: ./.github/actions/tabnine-pr-agent
ssh-key: ${{ secrets.ACTION_ACCESS_PRIVATE_SSH_KEY }}

- name: Analyse PR
uses: ./.github/actions/tabnine-pr-agent
- name: Review PR
uses: codota/tabnine-pr-agent@v1
continue-on-error: true
with:
PAT: ${{ secrets.COACHING_PAT }}
ref: origin/${{ github.head_ref }}
base_ref: origin/${{ github.base_ref }}
path_to_repo: ${{ github.workspace }}
repository_owner: ${{ github.repository_owner }}
repository_name: ${{ github.event.repository.name }}
pull_request_id: ${{ github.event.pull_request.number }}
github_token: ${{ secrets.GITHUB_TOKEN }}
```
Note: You'll need to configure a few `secrets` in your repository settings:
* COACHING_PAT (which should be obtained from the tabnine CLI)
```shell
tabnine auth status
```
* ACTION_ACCESS_PRIVATE_SSH_KEY (which should be obtained from Tabnine)

0 comments on commit 44fd8be

Please sign in to comment.