-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
88 lines (82 loc) · 2.31 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: 'Callstack.ai Reviewer'
description: 'Run Callstack.ai reviewer'
branding:
icon: 'play'
color: 'gray-dark'
inputs:
config:
description: 'Config for reviewer'
required: true
head:
description: 'Head commit sha'
required: true
openai_key:
description: 'OpenAI key'
required: false
default: ''
export:
description: 'Save logs to artifact'
required: false
channel:
description: 'Deployment channel (stable or pre-release)'
required: false
default: 'stable'
tag:
description: 'Docker image tag'
required: false
default: 'latest'
runs:
using: composite
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.head }}
- name: Set Docker image based on channel and tag
shell: bash
run: |
if [[ "${{ inputs.channel }}" == "pre-release" ]]; then
echo "DOCKER_IMAGE=callstackai/cal-staging:${{ inputs.tag }}" >> $GITHUB_ENV
else
echo "DOCKER_IMAGE=callstackai/cal:${{ inputs.tag }}" >> $GITHUB_ENV
fi
- name: Run reviewer without export
if: ${{ !inputs.export }}
uses: addnab/docker-run-action@v3
env:
OPENAI_KEY: ${{ inputs.openai_key }}
with:
image: ${{ env.DOCKER_IMAGE }}
options: -v ${{ github.workspace }}:/code
run: |
/reviewer \
--dir /code \
--id ${{ github.run_id }} \
--token ${{ github.token }} \
--config "${{ inputs.config }}"
- name: Run reviewer with export
if: ${{ inputs.export }}
uses: addnab/docker-run-action@v3
env:
OPENAI_KEY: ${{ inputs.openai_key }}
with:
image: ${{ env.DOCKER_IMAGE }}
options: -v ${{ github.workspace }}:/code
run: |
/reviewer \
--dir /code \
--id ${{ github.run_id }} \
--token ${{ github.token }} \
--config "${{ inputs.config }}" \
--export ${{ inputs.export }}
- name: Export Chat logs
uses: actions/upload-artifact@v4
if: ${{ inputs.export }}
with:
name: chat-logs
path: ${{ github.workspace }}/chats.json
- name: Export logs
uses: actions/upload-artifact@v4
with:
name: run-logs
path: ${{ github.workspace }}/output.log