Skip to content

Commit 20a1687

Browse files
authored
Merge pull request #141 from deadlydog/copilot-autofix-for-potential-code-injection
Potential fix for code scanning alert no. 1: Code injection
2 parents 38fc14d + 4496e7f commit 20a1687

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/process-new-powershell-tip-issue.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,12 @@ jobs:
7272
- name: Extract tip information from issue and create new tip file
7373
id: create-tip-file
7474
shell: pwsh
75+
env:
76+
# Avoid script injection by retrieving the issue body via an environment variable instead of injecting the text directly into the script.
77+
ISSUE_BODY: ${{ github.event.issue.body }}
7578
run: |
7679
Write-Output "Reading information from GitHub issue..."
77-
$body = @'
78-
${{ github.event.issue.body }}
79-
'@
80+
$body = $Env:ISSUE_BODY
8081
8182
Write-Output "Displaying issue body for troubleshooting purposes:"
8283
Write-Output "----------------------------------------"

0 commit comments

Comments
 (0)