@@ -44,6 +44,7 @@ export interface RenderOptions {
4444 includeFileLink : boolean ;
4545 includeCommitLink : boolean ;
4646 includePrLink : boolean ;
47+ sanitizeDiff : boolean ;
4748}
4849
4950export interface RenderedIssue {
@@ -116,7 +117,9 @@ function buildTemplateContext(
116117 const filename = path . basename ( file . path ) ;
117118
118119 // Format diff if included
119- const diff = options . includeDiff ? formatDiffAsCodeBlock ( fileDiff . diff ) : '' ;
120+ const formattedDiff = options . includeDiff ? formatDiffAsCodeBlock ( fileDiff . diff ) : '' ;
121+ // When sanitizeDiff=true, render diff as escaped string (no triple braces)
122+ const diff = options . sanitizeDiff ? formattedDiff : formattedDiff ;
120123 const diff_raw = options . includeDiff ? fileDiff . diff : '' ;
121124
122125 // Build file link
@@ -182,6 +185,12 @@ function resolveBodyTemplate(templateInput: string): string {
182185 if ( templateInput . endsWith ( '.md' ) || templateInput . includes ( '/' ) ) {
183186 try {
184187 const templatePath = path . resolve ( process . cwd ( ) , templateInput ) ;
188+ // Reject absolute paths or paths outside the workspace
189+ const repoRoot = process . cwd ( ) ;
190+ if ( ! templatePath . startsWith ( repoRoot ) ) {
191+ core . warning ( `Template path resolves outside repo root: ${ templatePath } . Using default template.` ) ;
192+ return DEFAULT_TEMPLATE ;
193+ }
185194 if ( fs . existsSync ( templatePath ) ) {
186195 core . debug ( `Loading template from file: ${ templatePath } ` ) ;
187196 return fs . readFileSync ( templatePath , 'utf-8' ) ;
0 commit comments