7
7
description :' GitHub Issue URL to process'
8
8
required :true
9
9
type :string
10
- context_key :
11
- description :' Unique context key (defaults to issue number)'
12
- required :true
13
- type :string
14
10
template_name :
15
11
description :' Coder template to use for workspace'
16
12
required :true
17
13
default :' ai-workspace'
18
14
type :string
15
+ prefix :
16
+ description :' Prefix for workspace name'
17
+ required :false
18
+ default :' triage'
19
+ type :string
19
20
20
21
21
22
jobs :
@@ -33,11 +34,19 @@ jobs:
33
34
uses :actions/checkout@v4
34
35
35
36
# 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 }}"
37
+ -name :Install gh CLI
38
+ run :|
39
+ sudo apt-get update -y && \
40
+ sudo apt-get install -y gh && \
41
+ gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
42
+
43
+ -name :Extract context key from issue
44
+ id :extract-context
45
+ run :|
46
+ issue_number=$(gh issue view "${{ inputs.issue_url }}" --json number --jq '.number')
47
+ context_key="gh-${issue_number}"
48
+ echo "context_key=${context_key}" >> $GITHUB_OUTPUT
49
+ echo "CONTEXT_KEY=${context_key}" >> $GITHUB_ENV
41
50
42
51
-name :Download and install Coder binary
43
52
shell :bash
59
68
-name :Create Coder workspace
60
69
id :create-workspace
61
70
run :|
62
- export WORKSPACE_NAME="gh-issue- ${{ inputs.context_key }}-${{ github.run_id }}"
71
+ export WORKSPACE_NAME="${{ inputs.prefix }}-${{ steps.extract-context.outputs .context_key }}-${{ github.run_id }}"
63
72
echo "Creating workspace: $WORKSPACE_NAME"
64
73
./scripts/traiage.sh create
65
74
echo "workspace_created=true" >> $GITHUB_OUTPUT
@@ -92,19 +101,25 @@ jobs:
92
101
echo "WORKSPACE_NAME: ${WORKSPACE_NAME}"
93
102
PROMPT=$(cat $PROMPT_FILE) ./scripts/traiage.sh prompt
94
103
95
- -name :Create andupload archive
96
- id :create-archive
104
+ -name :Commit andpush changes
105
+ id :commit-push
97
106
run :|
98
- echo "Creating archive for workspace: $WORKSPACE_NAME"
99
- archive_url=$(./scripts/traiage.sh archive)
100
- echo "archive_url=${archive_url}" >> $GITHUB_OUTPUT
107
+ echo "Committing and pushing changes in workspace: $WORKSPACE_NAME"
108
+ ./scripts/traiage.sh commit-push
109
+
110
+ # - name: Create and upload archive
111
+ # id: create-archive
112
+ # run: |
113
+ # echo "Creating archive for workspace: $WORKSPACE_NAME"
114
+ # archive_url=$(./scripts/traiage.sh archive)
115
+ # echo "archive_url=${archive_url}" >> $GITHUB_OUTPUT
101
116
102
117
-name :Report results
103
118
run :|
104
119
echo "## AI Triage Results" >> $GITHUB_STEP_SUMMARY
105
120
echo "- **Issue URL:** ${{ inputs.issue_url }}" >> $GITHUB_STEP_SUMMARY
106
121
echo "- **Context Key:** ${{ steps.extract-context.outputs.context_key }}" >> $GITHUB_STEP_SUMMARY
107
- echo "- **Workspace:** ${{ steps.extract-context .outputs.workspace_name }}" >> $GITHUB_STEP_SUMMARY
122
+ echo "- **Workspace:** ${{ steps.create-workspace .outputs.workspace_name }}" >> $GITHUB_STEP_SUMMARY
108
123
echo "- **Archive URL:** ${{ steps.create-archive.outputs.archive_url }}" >> $GITHUB_STEP_SUMMARY
109
124
110
125
-name :Cleanup workspace