actions-comment-pull-request
actions-comment-pull-request copied to clipboard
filePath content as code
when using filePath I would like the rendered file to be shown as code e.g. a yaml file shown as yaml in a code block
I was able to add some formatting by editing the file contents before commenting it. I added another step before the comment step:
...
- name: overwrite parts of the comment file
env:
FILE_PATH: ${{ path_to_file }}
run: |
echo "\`\`\`js" > tmp
cat $FILE_PATH >> tmp
echo "\`\`\`" >> tmp
mv tmp $FILE_PATH
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
filePath: ${{ path_to_file }}
comment_tag: pr_comment
...
After this, the message sent was in js format.