Skip to content

Commit 75336c0

Browse files
Test issue parser
1 parent 5e619f4 commit 75336c0

1 file changed

Lines changed: 3 additions & 54 deletions

File tree

.github/workflows/Auto-Assign.yml

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -28,60 +28,9 @@ jobs:
2828

2929
- uses: PSModule/Initialize-PSModule@main
3030

31-
- name: Test
32-
env:
33-
body: ${{ github.event.issue.body }}
34-
shell: pwsh
35-
run: |
36-
$VerbosePreference = "Continue"
37-
Start-LogGroup "Issue Body"
38-
$env:body
39-
Stop-LogGroup
40-
41-
Start-LogGroup "Issue Body Split"
42-
# Read the content of the file
43-
$content = $env:body.Split([Environment]::NewLine).Trim() | Where-Object { $_ -ne '' }
44-
45-
# Initialize an array to store the results
46-
$results = @()
47-
48-
# Initialize variables to store the current header and paragraph
49-
$currentHeader = ""
50-
$currentParagraph = ""
51-
52-
# Loop through each line of the file content
53-
foreach ($line in $content) {
54-
Write-Verbose "Processing line: [$line]"
55-
if ($line -match "^### (.+)$") {
56-
# If a new header is found, store the current header and paragraph in the results
57-
if ($currentHeader -ne "") {
58-
$results += [PSCustomObject]@{
59-
Header = $currentHeader
60-
Paragraph = $currentParagraph.Trim()
61-
}
62-
}
63-
64-
# Update the current header and reset the paragraph
65-
$currentHeader = $matches[1]
66-
$currentParagraph = ""
67-
} else {
68-
# Append the line to the current paragraph
69-
$currentParagraph += " " + $line
70-
}
71-
}
72-
73-
# Add the last header and paragraph to the results
74-
if ($currentHeader -ne "") {
75-
$results += [PSCustomObject]@{
76-
Header = $currentHeader
77-
Paragraph = $currentParagraph.Trim()
78-
}
79-
}
80-
81-
# Output the results
82-
$results | Format-Table -AutoSize
83-
84-
Stop-LogGroup
31+
- name: Get-IssueFormData
32+
id: Get-IssueFormData
33+
uses: PSModule/Get-IssueFormData@v1
8534

8635
- name: Acknowledge
8736
uses: actions/github-script@v7

0 commit comments

Comments
 (0)