|
28 | 28 |
|
29 | 29 | - uses: PSModule/Initialize-PSModule@main |
30 | 30 |
|
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 |
85 | 34 |
|
86 | 35 | - name: Acknowledge |
87 | 36 | uses: actions/github-script@v7 |
|
0 commit comments