Fracton
Fracton

Reputation: 241

How to save github actions output to the repo?

I am trying to use pandoc to convert markdown files pushed to my repo into pdfs. But, not sure how to save the output to my repo.

Here's my code:


name: pandoc

on: push

jobs: 
  convert_via_pandoc:
    runs-on: ubuntu-22.04
    steps:
    - uses: actions/checkout@v2
    - name: convert md to pdf 
      uses: docker://pandoc/latex:2.9
      with:
        entrypoint: /bin/sh
        run: |
         cd markdown-files; 
         for file in $(ls ./ |grep *.md); do 
          pandoc $file -o ${file:0:-2}pdf; 
          done            

Upvotes: 10

Views: 3796

Answers (1)

Grzegorz Krukowski
Grzegorz Krukowski

Reputation: 19802

You can simply push it back to the repository by committing it with one of the actions available on Marketplace:

- uses: stefanzweifel/git-auto-commit-action@v4
  with:
      commit_message: Changed files

Alternatively, you can upload your data as an artifact to your workflow: https://github.com/actions/upload-artifact

- uses: actions/upload-artifact@v3
  with:
    name: pdfs
    path: path/to/pdfs/

Upvotes: 10

Related Questions