-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
57 lines (51 loc) · 2.08 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: 'Analyze PR'
description: 'Analyze a pull request using the TabNine CLI'
inputs:
PAT:
required: true
description: 'Coaching Personal Access Token'
base_ref:
description: 'Target branch of the pull request in a workflow run'
default: 'origin/main'
ref:
description: 'Source branch of the pull request in a workflow run'
path_to_repo:
required: true
description: 'Path to the repository in the workflow run'
repository_owner:
required: true
description: 'GitHub workspace path'
repository_name:
required: true
description: 'Name of GitHub repository'
pull_request_id:
required: true
description: 'Pull request ID in a workflow run'
github_token:
required: true
description: 'GitHub token for authentication'
runs:
using: 'composite'
steps:
- name: Getting previous run state
uses: actions/cache@v3
continue-on-error: true
with:
key: storage-${{ github.ref_name }}
path: ./tabnine/storage.json
- name: Pull docker image
run: docker pull ghcr.io/codota/tabnine-cli:latest
shell: bash
- name: Run analyse
run: docker run --rm -v ./tabnine:/etc/tabnine_cli -v ${{inputs.path_to_repo}}:/opt/repository ghcr.io/codota/tabnine-cli:latest review diff -b ${{ inputs.base_ref }} -bf ${{ inputs.ref }} --token ${{inputs.PAT}} --workspace ${{ inputs.repository_owner }} --repo_slug ${{ inputs.repository_name }} --pr_id ${{ inputs.pull_request_id }} /opt/repository
shell: bash
- name: Saving state
uses: actions/cache@v3
continue-on-error: true
if: always()
with:
path: ./tabnine/storage.json
key: storage-${{ github.ref_name }}
- name: Check report in watch mode
run: docker run -e GITHUB_TOKEN=${{ inputs.github_token }} -e GITHUB_ACTION=__self --rm -v ./tabnine:/etc/tabnine_cli ghcr.io/codota/tabnine-cli:latest review report --format github --token ${{inputs.PAT}} --workspace ${{ inputs.repository_owner }} --repo_slug ${{ inputs.repository_name }} --pr_id ${{ inputs.pull_request_id }} --last --watch
shell: bash