File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,9 @@ var loadAgentOutputScript string
115115//go:embed js/lock-issue.cjs
116116var lockIssueScript string
117117
118+ //go:embed js/unlock-issue.cjs
119+ var unlockIssueScript string
120+
118121//go:embed js/staged_preview.cjs
119122var stagedPreviewScript string
120123
@@ -282,6 +285,7 @@ func GetJavaScriptSources() map[string]string {
282285 "sanitize_workflow_name.cjs" : sanitizeWorkflowNameScript ,
283286 "load_agent_output.cjs" : loadAgentOutputScript ,
284287 "lock-issue.cjs" : lockIssueScript ,
288+ "unlock-issue.cjs" : unlockIssueScript ,
285289 "staged_preview.cjs" : stagedPreviewScript ,
286290 "assign_agent_helpers.cjs" : assignAgentHelpersScript ,
287291 "safe_output_helpers.cjs" : safeOutputHelpersScript ,
Original file line number Diff line number Diff line change 1+ // @ts -check
2+ /// <reference types="@actions/github-script" />
3+
4+ /**
5+ * Unlock a GitHub issue
6+ * This script is used in the conclusion job to ensure the issue is unlocked
7+ * after agent workflow execution completes or fails
8+ */
9+
10+ async function main ( ) {
11+ // Get issue number from context
12+ const issueNumber = context . issue . number ;
13+
14+ if ( ! issueNumber ) {
15+ core . setFailed ( "Issue number not found in context" ) ;
16+ return ;
17+ }
18+
19+ const owner = context . repo . owner ;
20+ const repo = context . repo . repo ;
21+
22+ core . info ( `Unlocking issue #${ issueNumber } after agent workflow execution` ) ;
23+
24+ try {
25+ // Unlock the issue
26+ await github . rest . issues . unlock ( {
27+ owner,
28+ repo,
29+ issue_number : issueNumber ,
30+ } ) ;
31+
32+ core . info ( `✅ Successfully unlocked issue #${ issueNumber } ` ) ;
33+ } catch ( error ) {
34+ const errorMessage = error instanceof Error ? error . message : String ( error ) ;
35+ core . error ( `Failed to unlock issue: ${ errorMessage } ` ) ;
36+ core . setFailed ( `Failed to unlock issue #${ issueNumber } : ${ errorMessage } ` ) ;
37+ }
38+ }
39+
40+ await main ( ) ;
You can’t perform that action at this time.
0 commit comments