Repository navigation
70 lines (62 loc) · 2.16 KB
/
Copy pathpi.yml
File metadata and controls
70 lines (62 loc) · 2.16 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
name: Pi AI Agent
on:
workflow_call:
inputs:
prompt:
type: string
required: false
allowed_actor:
type: string
required: false
secrets:
token:
required: true
gh_token:
required: true
opengist_token:
# Opengist access token (og_…) used by the opengist share provider.
# Must be declared here so callers can pass it through — reusable
# workflows only see secrets listed under `workflow_call.secrets`, so
# an undeclared `secrets.OPENGIST_TOKEN` silently resolves to empty.
required: false
permissions:
contents: write
issues: write
pull-requests: write
jobs:
pi-agent:
if: |
(startsWith(github.event.comment.body, '/pi ') || startsWith(github.event.review.body, '/pi ')) &&
(inputs.allowed_actor == '' || github.actor == inputs.allowed_actor)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
fetch-depth: 0
- uses: actions/setup-node@v7
with:
node-version: 24
- name: Run Pi agent
id: pi
uses: shaftoe/pi-coding-agent-action@develop
env:
PI_SHARE_VIEWER_URL: https://gistviewer.l3x.in/
with:
share_session: true
share_gist_provider: opengist
share_gist_api_url: https://gist.l3x.in/api/gists
share_gist_token: ${{ secrets.opengist_token }}
github_token: ${{ secrets.gh_token }}
provider: ${{ vars.PROVIDER }}
model: ${{ vars.MODEL }}
token: ${{ secrets.token }}
thinking_level: ${{ vars.THINKING_LEVEL }}
prompt: ${{ inputs.prompt }}
diff_ignore_patterns: 'dist/ pnpm-lock.yaml node_modules/'
- uses: actions/upload-artifact@v7
if: ${{ steps.pi.outputs.session_html_path }}
with:
name: pi-session-html-${{ github.event.issue.number || github.event.pull_request.number || github.run_number }}
path: ${{ steps.pi.outputs.session_html_path }}