Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filePath content as code #313

Open
darren-rose opened this issue Nov 16, 2023 · 1 comment · May be fixed by #322
Open

filePath content as code #313

darren-rose opened this issue Nov 16, 2023 · 1 comment · May be fixed by #322

Comments

@darren-rose
Copy link

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

yorhodes added a commit to yorhodes/actions-comment-pull-request that referenced this issue Nov 29, 2023
This was referenced Nov 29, 2023
@mindler-olli
Copy link

mindler-olli commented Dec 13, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants