7777 node lib/node_modules/@stdlib/error/tools/pkg2id/scripts/build.js
7878 node lib/node_modules/@stdlib/error/tools/id2pkg/scripts/build.js
7979
80- # Generate Markdown table of added error codes:
81- - name : ' Generate Markdown table of added error codes'
82- id : generate-markdown-table
80+ # Generate comment with Markdown table of added error codes:
81+ - name : ' Generate comment body with Markdown table of added error codes'
82+ id : generate-comment-body
8383 run : |
8484 # Get the diff of the CSV file:
8585 git_diff=$(git diff lib/node_modules/@stdlib/error/tools/database/data/data.csv)
@@ -113,6 +113,15 @@ jobs:
113113
114114 # Assign the table to an output variable:
115115 echo "table=${table}" >> $GITHUB_OUTPUT
116+
117+ # Generate a comment body:
118+ body="This PR\n\n- updates the error databases\n\nThe following error codes were added:\n\n${table}"
119+
120+ # Add the comment body to the workflow output after escaping to preserve newlines:
121+ body="${body//'%'/'%25'}"
122+ body="${body//$'\n'/'%0A'}"
123+ body="${body//$'\r'/'%0D'}"
124+ echo "body=${body}" >> $GITHUB_OUTPUT
116125
117126 # Disable Git hooks:
118127 - name : ' Disable Git hooks'
@@ -125,22 +134,14 @@ jobs:
125134 uses : peter-evans/create-pull-request@v4
126135 with :
127136 title : ' Update error databases'
128- body : |
129- This PR
130-
131- - updates the error databases
132-
133- The following error codes were added:
134-
135- ${{ steps.generate-markdown-table.outputs.table }}
136-
137+ body : ${{ steps.generate-comment-body.outputs.body }}
137138 commit-message : ' feat: update error databases'
138139 committer : ' stdlib-bot <noreply@stdlib.io>'
139140 token : ${{ secrets.PULL_REQUEST_TOKEN }}
140141 labels : |
141142 documentation
142143 automated-pr
143144 team-reviewers : |
144- stdlib- reviewers
145+ reviewers
145146 branch : update-error-databases
146147 delete-branch : true
0 commit comments