diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 144be10..66da920 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -8,6 +8,7 @@ on: permissions: contents: write + pull-requests: write # Add this for PR comments # Make sure we only ever run one per branch so we don't have issues pushing # after running the pipeline @@ -58,6 +59,26 @@ jobs: - run: calkit save -am "Run pipeline" env: CALKIT_DVC_TOKEN: ${{ secrets.CALKIT_DVC_TOKEN }} + - name: Upload PDF artifact + uses: actions/upload-artifact@v4 + with: + name: paper-pdf + path: paper/paper.pdf + if-no-files-found: warn + - name: Comment on PR with PDF link + if: github.event_name == 'pull_request' + uses: actions/github-script@v7 + with: + script: | + const fs = require('fs'); + if (fs.existsSync('paper/paper.pdf')) { + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '📄 **Pipeline completed!** The generated PDF is available as an artifact in this workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' + }); + } - name: Save DVC cache id: cache-dvc-save uses: actions/cache/save@v4 diff --git a/dvc.lock b/dvc.lock index 4280a37..4f2c464 100644 --- a/dvc.lock +++ b/dvc.lock @@ -65,13 +65,13 @@ stages: nfiles: 2 - path: paper/paper.tex hash: md5 - md5: 09f2923d7ec5a75fefe95497d6e177cd - size: 678 + md5: 1480301e18c57bf533d604e1a3593101 + size: 653 outs: - path: paper/paper.pdf hash: md5 - md5: bff1721a57af4275b13af9dd8033ad9a - size: 95417 + md5: 13ee8eb76f777de6242c16c15d054673 + size: 94915 _check_env_py: cmd: calkit check conda-env --file environment.yml --output .calkit/env-locks/py.yml diff --git a/paper/paper.tex b/paper/paper.tex index eb6bd3a..7790868 100644 --- a/paper/paper.tex +++ b/paper/paper.tex @@ -40,8 +40,6 @@ \section{Section 2} This is another sentence in the second section. -This was added in a PR. - %--/Paper-- \end{document}