Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5dd8337

Browse files
committed
.github/workflows/traiage.yaml: local testing via nektos/act
1 parent451b05c commit5dd8337

File tree

1 file changed

+46
-41
lines changed

1 file changed

+46
-41
lines changed

‎.github/workflows/traiage.yaml‎

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,84 +9,91 @@ on:
99
type:string
1010
context_key:
1111
description:'Unique context key (defaults to issue number)'
12-
required:false
12+
required:true
1313
type:string
1414
template_name:
1515
description:'Coder template to use for workspace'
16-
required:false
16+
required:true
1717
default:'ai-workspace'
1818
type:string
1919

20-
env:
21-
CODER_URL:${{ secrets.CODER_URL }}
22-
CODER_SESSION_TOKEN:${{ secrets.CODER_SESSION_TOKEN }}
23-
TEMPLATE_NAME:${{ inputs.template_name }}
2420

2521
jobs:
2622
triage:
27-
name:AITriageProcessing
23+
name:TriageGitHub Issue with Claude Code
2824
runs-on:ubuntu-latest
2925
timeout-minutes:30
26+
env:
27+
CODER_URL:${{ secrets.CODER_URL }}
28+
CODER_SESSION_TOKEN:${{ secrets.CODER_SESSION_TOKEN }}
29+
TEMPLATE_NAME:${{ inputs.template_name }}
3030

3131
steps:
3232
-name:Checkout repository
3333
uses:actions/checkout@v4
3434

35-
-name:Install Coder CLI
36-
uses:coder/setup-coder@latest
35+
# NOTE: Only required for local testing via nektos/act
36+
# - name: Install gh CLI
37+
# run: |
38+
# sudo apt-get update -y && \
39+
# sudo apt-get install -y gh && \
40+
# gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
3741

38-
-name:Extract context key from issue URL
39-
id:extract-context
42+
-name:Download and install Coder binary
43+
shell:bash
44+
env:
45+
CODER_URL:${{ secrets.CODER_URL }}
4046
run:|
41-
if [[ -n"${{inputs.context_key }}"]]; then
42-
echo "context_key=${{ inputs.context_key }}" >> $GITHUB_OUTPUT
47+
if ["${{runner.arch }}"== "ARM64"]; then
48+
ARCH="arm64"
4349
else
44-
# Extract issue number from URL (e.g., https://github.com/owner/repo/issues/123 -> 123)
45-
issue_number=$(echo "${{ inputs.issue_url }}" | grep -oE '/issues/([0-9]+)' | grep -oE '[0-9]+')
46-
echo "context_key=issue_${issue_number}" >> $GITHUB_OUTPUT
50+
ARCH="amd64"
4751
fi
48-
49-
# Generate unique workspace name
50-
timestamp=$(date +%s)
51-
workspace_name="triage-$(echo "${{ inputs.context_key || 'auto' }}" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g')-${timestamp}"
52-
echo "workspace_name=${workspace_name}" >> $GITHUB_OUTPUT
52+
mkdir -p "$HOME"/.local/bin
53+
curl -fsSL --compressed "$CODER_URL"/bin/coder-linux-${ARCH} -o "$HOME"/.local/bin/coder
54+
chmod +x "$HOME"/.local/bin/coder
55+
echo "$HOME/.local/bin" >> $GITHUB_PATH
56+
"$HOME"/.local/bin/coder version
57+
"$HOME"/.local/bin/coder whoami
5358
5459
-name:Create Coder workspace
5560
id:create-workspace
56-
env:
57-
WORKSPACE_NAME:${{ steps.extract-context.outputs.workspace_name }}
5861
run:|
62+
export WORKSPACE_NAME="gh-issue-${{ inputs.context_key }}-${{ github.run_id }}"
5963
echo "Creating workspace: $WORKSPACE_NAME"
6064
./scripts/traiage.sh create
6165
echo "workspace_created=true" >> $GITHUB_OUTPUT
66+
echo "workspace_name=$WORKSPACE_NAME" >> $GITHUB_OUTPUT
67+
echo "WORKSPACE_NAME=${WORKSPACE_NAME}" >> $GITHUB_ENV
6268
63-
-name:PrepareAIprompt
69+
-name:Send prompt toAIagent inside workspace
6470
id:prepare-prompt
6571
run:|
72+
PROMPT_FILE=/tmp/prompt.txt
73+
trap 'rm -f ${PROMPT_FILE}' EXIT
74+
6675
# Extract issue content and prepare prompt
6776
issue_url="${{ inputs.issue_url }}"
6877
context_key="${{ steps.extract-context.outputs.context_key }}"
6978
70-
#Create a prompt that includes theissueURL and context
71-
prompt="Process GitHub issue: ${issue_url}. Context key: ${context_key}. Please analyze theissue, understand the requirements, and create appropriate solutions."
79+
#Fetchissuedescription using `gh` CLI
80+
issue_description=$(ghissue view "$issue_url")
7281
73-
#Escape the promptfor shell usage
74-
escaped_prompt=$(printf '%s\n' "$prompt" | sed 's/[\[\](){}.*^$+?|\\]/\\&/g')
75-
echo "prompt=${escaped_prompt}" >> $GITHUB_OUTPUT
82+
#Write a promptto PROMPT_FILE
83+
cat > "${PROMPT_FILE}" <<EOF
84+
Analyze the below GitHub issue description, understand the root cause, and make appropriate changes to resolve the issue.
7685
77-
-name:Execute AI processing
78-
id:ai-process
79-
env:
80-
WORKSPACE_NAME:${{ steps.extract-context.outputs.workspace_name }}
81-
PROMPT:${{ steps.prepare-prompt.outputs.prompt }}
82-
run:|
83-
echo "Sending prompt to AI agent in workspace: $WORKSPACE_NAME"
84-
./scripts/traiage.sh prompt
86+
ISSUE URL: ${issue_url}
87+
ISSUE DESCRIPTION BELOW:
88+
89+
${issue_description}
90+
EOF
91+
92+
echo "WORKSPACE_NAME: ${WORKSPACE_NAME}"
93+
PROMPT=$(cat $PROMPT_FILE)./scripts/traiage.sh prompt
8594
8695
-name:Create and upload archive
8796
id:create-archive
88-
env:
89-
WORKSPACE_NAME:${{ steps.extract-context.outputs.workspace_name }}
9097
run:|
9198
echo "Creating archive for workspace: $WORKSPACE_NAME"
9299
archive_url=$(./scripts/traiage.sh archive)
@@ -102,8 +109,6 @@ jobs:
102109
103110
-name:Cleanup workspace
104111
if:always() && steps.create-workspace.outputs.workspace_created == 'true'
105-
env:
106-
WORKSPACE_NAME:${{ steps.extract-context.outputs.workspace_name }}
107112
run:|
108113
echo "Cleaning up workspace: $WORKSPACE_NAME"
109114
./scripts/traiage.sh delete ||true

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp