-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
97 lines (97 loc) · 3.19 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
89
90
91
92
93
94
95
96
97
name: 'puLL-Merge'
description: 'puLL-Merge is a github-action to add LLM capabilities to pull-requests in github automatically'
inputs:
github_token:
description: |
Secret token to push review comments, and
interact with the repository systematically
required: true
openai_api_key:
description: |
API key to interact with the OpenAI endpoint
anthropic_api_key:
description: |
API key to interact with the Anthropic endpoint
debounce_time:
description: |
Debounce Time in hours
amplification:
description: |
Amplification factor for the generated text
filterdiff_args:
description: |
Arguments to pass to filterdiff
openai_models:
description: |
selection of models to use for the openai endpoint
anthropic_models:
description: |
selection of models to use for the anthropic endpoint
bedrock_models:
description: |
selection of models to use for the bedrock endpoint
run_if_private:
description: |
run the action even if the repository is private
debug:
description: enables debug output for this action
required: false
repo:
description: |
force the repository to run the action on
required: false
owner:
description: |
force the owner to run the action on
required: false
prnum:
description: |
force the pull request number to run the action on
required: false
max_tokens:
description: |
maximum number of tokens to generate
required: false
bedrock_aws_iam_role_arn:
description: |
AWS IAM Role ARN to interact with the Bedrock endpoint
default: ""
region:
description: |
AWS region to interact with the Bedrock endpoint
default: ""
include_diff:
description: |
Include the diff in the generated text
required: false
# outputs:
runs:
using: 'composite'
steps:
- if: ${{ inputs.bedrock_aws_iam_role_arn != '' && inputs.region != ''}}
name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
role-to-assume: ${{ inputs.bedrock_aws_iam_role_arn }}
aws-region: ${{ inputs.region }}
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: '20.x'
- name: Install patchutils
run: sudo apt-get install -y patchutils
shell: bash
- id: npm
run: cd ${{ github.action_path }}; npm ci
shell: bash
- id: llm-and-post-message
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: ${{ !contains(github.event.pull_request.labels.*.name, 'CI/skip-llm') && !contains(github.event.pull_request.labels.*.name, 'CI/skip') && github.event.pull_request.draft == false }}
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
DEBUG: ${{ (inputs.debug == 'true' || runner.debug) && 'true' || 'false'}}
with:
script: |
const actionPath = '${{ github.action_path }}'
const script = require(`${actionPath}/action.cjs`)
const inputs = ${{ toJson(inputs) }}
await script({github, context, inputs, actionPath})