-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathaction.yml
More file actions
86 lines (79 loc) · 2.93 KB
/
action.yml
File metadata and controls
86 lines (79 loc) · 2.93 KB
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
name: "Augment Describe PR"
description: "AI-powered PR Descriptions"
author: "Augment Code"
branding:
icon: "zap"
color: "purple"
inputs:
augment_session_auth:
description: "Augment session authentication JSON containing accessToken and tenantURL. Store as repository secret for security."
required: true
github_token:
description: "GitHub token for API access. Must have 'repo' scope."
required: true
pull_number:
description: "The number of the pull request being described"
required: true
repo_name:
description: "The full name (owner/repo) of the repository"
required: true
custom_guidelines:
description: "Optional custom guidelines to include in PR description generation. Provide additional instructions or requirements specific to your project."
required: false
model:
description: "Optional model to use for generation. Passed directly to augment-agent."
required: false
rules:
description: "Optional JSON array of rules file paths forwarded to augment-agent."
required: false
mcp_configs:
description: "Optional JSON array of MCP config file paths forwarded to augment-agent."
required: false
runs:
using: "composite"
steps:
- name: Checkout PR Head
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
token: ${{ inputs.github_token }}
ref: refs/pull/${{ inputs.pull_number }}/head
fetch-depth: 0
- name: Prepare Custom Context
id: custom_context
shell: bash
run: |
if [ -n "$CUSTOM_GUIDELINES" ]; then
echo 'context<<EOF' >> $GITHUB_OUTPUT
echo "$(jq -n --arg guidelines "$CUSTOM_GUIDELINES" '{custom_guidelines: $guidelines}')" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
else
echo "context={}" >> $GITHUB_OUTPUT
fi
env:
CUSTOM_GUIDELINES: ${{ inputs.custom_guidelines }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install Dependencies
run: npm ci --production=false
shell: bash
working-directory: ${{ github.action_path }}
- name: Build TypeScript
run: npm run build
shell: bash
working-directory: ${{ github.action_path }}
- name: Run Augment Agent
run: node ${{ github.action_path }}/dist/index.js
shell: bash
env:
INPUT_AUGMENT_SESSION_AUTH: ${{ inputs.augment_session_auth }}
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
INPUT_PULL_NUMBER: ${{ inputs.pull_number }}
INPUT_REPO_NAME: ${{ inputs.repo_name }}
INPUT_CUSTOM_GUIDELINES: ${{ inputs.custom_guidelines }}
INPUT_MODEL: ${{ inputs.model }}
INPUT_RULES: ${{ inputs.rules }}
INPUT_MCP_CONFIGS: ${{ inputs.mcp_configs }}
INPUT_TEMPLATE_DIRECTORY: "${{ github.action_path }}/templates"
INPUT_CUSTOM_CONTEXT: ${{ steps.custom_context.outputs.context }}