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

ci: add workflow for agentic issue triage#19839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
johnstcn merged 23 commits intomainfromcj/hack/traiage
Sep 22, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
23 commits
Select commitHold shift + click to select a range
4190d01
hack: add wrapper script for AI-triage
johnstcnSep 15, 2025
40199e1
archive
johnstcnSep 15, 2025
c408273
add workflow
johnstcnSep 15, 2025
082f24d
set low TTL on workspace
johnstcnSep 16, 2025
4099aa8
scripts/triage.sh: post to agentapi
johnstcnSep 16, 2025
3140885
scripts/traiage.sh: add wait()
johnstcnSep 16, 2025
5483ae0
scripts/triage.sh: fix prompting over SSH, keep agentapi around
johnstcnSep 16, 2025
99dbfad
scripts/traiage.sh: cleanup ssh-config
johnstcnSep 16, 2025
8c03a76
scripts/traiage.sh: archive is not yet implemented
johnstcnSep 16, 2025
e519504
.github/workflows/traiage.yaml: local testing via nektos/act
johnstcnSep 16, 2025
39f6791
make fmt
johnstcnSep 17, 2025
f5fd496
dangerous
johnstcnSep 17, 2025
9042463
scripts/traiage.sh: add option to commit and push
johnstcnSep 17, 2025
85c7af7
.github/workflows/traiage.yaml: add push step
johnstcnSep 17, 2025
4634da0
make fmt
johnstcnSep 18, 2025
d682786
appease zizmor
johnstcnSep 18, 2025
7dd78d7
add persistence mode
johnstcnSep 18, 2025
736f019
scripts: implement archive functionality using gcloud
johnstcnSep 18, 2025
1683c7c
prefix secrets with TRAIAGE_
johnstcnSep 18, 2025
cb2c111
fixup after local testing
johnstcnSep 18, 2025
52a1d0c
address PR comments
johnstcnSep 19, 2025
56e3a11
fmt
johnstcnSep 19, 2025
574d114
add template parameters
johnstcnSep 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 155 additions & 0 deletions.github/workflows/traiage.yaml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
name: AI Triage Automation

on:
workflow_dispatch:
inputs:
issue_url:
description: 'GitHub Issue URL to process'
required: true
type: string
template_name:
description: 'Coder template to use for workspace'
required: true
default: 'ai-workspace'
type: string
prefix:
description: 'Prefix for workspace name'
required: false
default: 'traiage'
type: string
persistence_mode:
description: 'Persistence mode (push or archive)'
required: false
type: choice
options:
- push
- archive
default: 'archive'

jobs:
traiage:
name: Triage GitHub Issue with Claude Code
runs-on: ubuntu-latest
timeout-minutes: 30
env:
CODER_URL: ${{ secrets.TRAIAGE_CODER_URL }}
CODER_SESSION_TOKEN: ${{ secrets.TRAIAGE_CODER_SESSION_TOKEN }}
TEMPLATE_NAME: ${{ inputs.template_name }}
permissions:
contents: read
issues: write
actions: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- name: Extract context key from issue
id: extract-context
env:
ISSUE_URL: ${{ inputs.issue_url }}
run: |
issue_number="$(gh issue view "${ISSUE_URL}" --json number --jq '.number')"
context_key="gh-${issue_number}"
echo "context_key=${context_key}" >> "${GITHUB_OUTPUT}"
echo "CONTEXT_KEY=${context_key}" >> "${GITHUB_ENV}"

- name: Download and install Coder binary
shell: bash
env:
CODER_URL: ${{ secrets.TRAIAGE_CODER_URL }}
run: |
if [ "${{ runner.arch }}" == "ARM64" ]; then
ARCH="arm64"
else
ARCH="amd64"
fi
mkdir -p "${HOME}/.local/bin"
curl -fsSL --compressed "$CODER_URL/bin/coder-linux-${ARCH}" -o "${HOME}/.local/bin/coder"
chmod +x "${HOME}/.local/bin/coder"
export PATH="$HOME/.local/bin:$PATH"
coder version
coder whoami
echo "$HOME/.local/bin" >> "${GITHUB_PATH}"

- name: Create Coder workspace
id: create-workspace
env:
PREFIX: ${{ inputs.prefix }}
CONTEXT_KEY: ${{ steps.extract-context.outputs.context_key }}
RUN_ID: ${{ github.run_id }}
TEMPLATE_PARAMETERS: ${{ secrets.TRAIAGE_TEMPLATE_PARAMETERS }}
run: |
export WORKSPACE_NAME="${PREFIX}-${CONTEXT_KEY}-${RUN_ID}"
echo "Creating workspace: $WORKSPACE_NAME"
./scripts/traiage.sh create
echo "workspace_name=$WORKSPACE_NAME" >> "${GITHUB_OUTPUT}"
echo "WORKSPACE_NAME=${WORKSPACE_NAME}" >> "${GITHUB_ENV}"

- name: Send prompt to AI agent inside workspace
id: prepare-prompt
env:
WORKSPACE_NAME: ${{ steps.create-workspace.outputs.workspace_name }}
ISSUE_URL: ${{ inputs.issue_url }}
run: |
PROMPT_FILE=/tmp/prompt.txt
trap 'rm -f "${PROMPT_FILE}"' EXIT

# Fetch issue description using `gh` CLI
issue_description=$(gh issue view "${ISSUE_URL}")

# Write a prompt to PROMPT_FILE
cat > "${PROMPT_FILE}" <<EOF
Analyze the below GitHub issue description, understand the root cause, and make appropriate changes to resolve the issue.

ISSUE URL: ${ISSUE_URL}
ISSUE DESCRIPTION BELOW:

${issue_description}
EOF

echo "WORKSPACE_NAME: ${WORKSPACE_NAME}"
# This command will run the prompt inside the workspace
# and exit once the agent has completed the task.
PROMPT=$(cat $PROMPT_FILE) ./scripts/traiage.sh prompt

- name: Commit and push changes
id: commit-push
if: ${{ inputs.persistence_mode == 'push' }}
run: |
echo "Committing and pushing changes in workspace: $WORKSPACE_NAME"
./scripts/traiage.sh commit-push

- name: Create and upload archive
id: create-archive
if: ${{ inputs.persistence_mode == 'archive' }}
env:
DESTINATION_PREFIX: ${{ secrets.TRAIAGE_DESTINATION_PREFIX }}
run: |
echo "Creating archive for workspace: $WORKSPACE_NAME"
./scripts/traiage.sh archive
echo "archive_url=${DESTINATION_PREFIX%%/}/$WORKSPACE_NAME.tar.gz" >> "${GITHUB_OUTPUT}"

- name: Report results
env:
ISSUE_URL: ${{ inputs.issue_url }}
CONTEXT_KEY: ${{ steps.extract-context.outputs.context_key }}
WORKSPACE_NAME: ${{ steps.create-workspace.outputs.workspace_name }}
ARCHIVE_URL: ${{ steps.create-archive.outputs.archive_url }}
run: |
{
echo "## TrAIage Results";
echo "- **Issue URL:** ${ISSUE_URL}";
echo "- **Context Key:** ${CONTEXT_KEY}";
echo "- **Workspace:** ${WORKSPACE_NAME}";
echo "- **Archive URL:** ${ARCHIVE_URL}"
} >> "${GITHUB_STEP_SUMMARY}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Could we also output here how to utilize the artifact?

PS. What's the difference of throwing it into step summary vs just outputting to stdout?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

GITHUB_STEP_SUMMARY will let you emit markdown that's visible in the job execution log

ref:https://github.blog/news-insights/product-news/supercharging-github-actions-with-job-summaries/

mafredri reacted with heart emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Regarding the "how-to" -- I think we will want to add some level of automation around this in the associated template. Something like the below:

data "coder_parameter" "resume_context_key" {  name = "resume_context_key"  type = "string"  default = ""}locals {  archive_url = "gs://${var.gcp_bucket}/traiage/${context_key}"}resource "coder_script" "fetch_context" { ... }

mafredri reacted with thumbs up emoji

- name: Cleanup workspace
if: steps.create-workspace.outputs.workspace_name != '' && (inputs.persistence_mode == 'archive' && steps.create-archive.outputs.archive_url != '')
run: |
echo "Cleaning up workspace: $WORKSPACE_NAME"
./scripts/traiage.sh delete || true
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp