openjournals-draft-action icon indicating copy to clipboard operation
openjournals-draft-action copied to clipboard

no PDF is generated

Open Yingjie4Science opened this issue 3 years ago • 11 comments
trafficstars

Hi, here is the edited action in my repo https://github.com/Yingjie4Science/SDGdetector/blob/main/.github/workflows/draft-pdf.yml. There is no error, but no PDF is found in the repo, see https://github.com/Yingjie4Science/SDGdetector/tree/main/paper. Any advice? Thanks!

Yingjie4Science avatar Oct 24 '22 21:10 Yingjie4Science

I have a similar issue with the following error message:

Run openjournals/openjournals-draft-action@master
  with:
    journal: joss
    paper-path: paper.md
/usr/bin/docker run --name openjournalsinaralatest_e1c88f --label 8d5581 --workdir /github/workspace --rm -e "INPUT_JOURNAL" -e "INPUT_PAPER-PATH" -e "GIT_SHA" -e "JOURNAL" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/edecob/edecob":"/github/workspace" openjournals/inara:latest  "-o pdf" "paper.md"
YAML parse exception at line 19, column 1,
while parsing a block mapping:
did not find expected key

manzhch avatar Oct 25 '22 08:10 manzhch

I was also confused by this as it's not very clear from the documentation. The pdf isn't supposed to appear in the repository, it will appear as an 'artifact' of the github action.

For your repository, click the actions tab, then click the latest successful action. Then scroll down to the bottom of the screen and you should see a section marked artifacts that contains something with the name paper. Click on that and it'll download a zipped copy of the pdf. For your latest successful build you can see the paper at the bottom of this link, for example: https://github.com/Yingjie4Science/SDGdetector/actions/runs/3316984180

(note: On my machine the download is failing for some reason, both for your repo and my own, but I think this is a temporary issue as it worked yesterday)

simonrp84 avatar Oct 25 '22 12:10 simonrp84

Thank you so much! Now I see the generated paper.pdf, and I can download it on my side, which is great! Thanks again!

Yingjie4Science avatar Oct 26 '22 16:10 Yingjie4Science

Thanks @simonrp84 I was confused by this also. I wonder why it cannot save to the folder directly? Would it not be simpler? I wonder if there is a way to automatize this action in the GHA so that we also always have access to the latest PDF in the folder without having to go to the workflow run, download the zip locally, unzip the file, and then reupload the PDF to github... If someone knows a solution I would be happy to hear it.

rempsyc avatar Nov 02 '22 16:11 rempsyc

Ok got it! Just add the following as the last step of the GHA:

- name: save pdf to repo
  uses: stefanzweifel/git-auto-commit-action@v4
  with:
    commit_message: Saved new PDF of paper

rempsyc avatar Nov 02 '22 16:11 rempsyc

Hi I am receiving an error generating a pdf file and I am not sure what the reason is. Would it be possible to consult someone to check if my markdown syntax and my yml files are correct?

mn5hk avatar Apr 03 '23 11:04 mn5hk

@rempsyc I run into the same problem. I didn't want to commit the paper.pdf from my local built so I added it to the .gitignore. Do you know whether your addition to the github action is in conflict with that? I'm also just looking for an automated link where I can read the current state of the paper.md as pdf

milankl avatar Sep 15 '23 15:09 milankl

I think I had not added paper.pdf to .gitignore, so when the action ran, it just overwrote my local paper.pdf. Perhaps it conflicts. You should try removing it from .gitignore to see if it solves the issue (just in case). Note that this approach ended up a bit cumbersome as I had to pull changes (to receive the new PDF) every time I made a new commit and sometimes forgot so had to merge, etc.

rempsyc avatar Sep 15 '23 15:09 rempsyc

Okay will give it a try, it would be nice if the pdf could just be deployed similar to the documentation, with the actual pdf outside of the pull request

milankl avatar Sep 15 '23 15:09 milankl

For the record: Yes, having the paper.pdf in the .gitignore will effectively disable the github action commiting the paper.pdf that same pull request

milankl avatar Sep 15 '23 20:09 milankl

In case of further elaboration on this https://github.com/openjournals/openjournals-draft-action/issues/15#issuecomment-1290478150

image

shayandavoodii avatar Feb 21 '24 15:02 shayandavoodii