Add manually-triggered GitHub Actions workflow for LaTeX diff generation#5
Add manually-triggered GitHub Actions workflow for LaTeX diff generation#5
Conversation
Co-authored-by: labarba <4800109+labarba@users.noreply.github.com>
Co-authored-by: labarba <4800109+labarba@users.noreply.github.com>
|
@piyueh – Would you mind giving this idea a sanity check? It occurred to me that it would be very nice to have a manually-triggered GitHub action that runs |
|
I think this is very helpful if it works. But I'm not very familiar with GitHub Actions scripts. Let me ask another AI to take a look... |
|
@codex Can you review this pull request? |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e3193f0a25
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
.github/workflows/latexdiff.yml
Outdated
| TEX_FILE="main.tex" | ||
| git show ${{ steps.ref.outputs.ref }}:$TEX_FILE > old.tex | ||
| latexdiff old.tex $TEX_FILE > diff.tex |
There was a problem hiding this comment.
Include \input files in diff generation
The workflow runs latexdiff only on main.tex, but in this repo main.tex is largely just a series of \input{...} section files. As a result, edits inside files like introduction.tex, methods.tex, etc. won’t appear in diff.tex, so the produced PDF can look unchanged even when the document content changed. To make the diff reliable, the diff step needs to flatten/include the \input files (e.g., latexdiff --flatten or latexdiff-vc).
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
@copilot Is this a concern? If yes, can you fix it?
There was a problem hiding this comment.
@codex Read the latest commit and see if this is fixed.
|
@copilot There is a concer/comment for you to address: #5 (comment) Please. |
Co-authored-by: piyueh <7220966+piyueh@users.noreply.github.com>
Fixed in commit 60548c6. Added |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 60548c685c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
OMG this thread is fascinating |
|
@copilot I made some changes. Review the latest commit. |
Reviewed commit c4119d5. Excellent fix! Using |
|
@codex Can you give this PR another pass of review? |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4119d54d2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex Any other issues? |
Review Outcome: No Additional Issues FoundAfter reviewing the current workflow, I don’t see any additional issues beyond those already addressed. The workflow now (1) fails clearly when no tag is available and Commands Used
Testing
|
|
@copilot I am happy with the PR now. Do another round of review and confirm you are okay with changes I made. |
Reviewed the complete workflow. All changes look excellent: ✅ The workflow is ready to merge and will work correctly for generating LaTeX diffs. |
@labarba I'm not familiar with GitHub Actions scripts, but Codex and Copilot are both happy with this PR now 😆 |
|
@piyueh – I created a tag for the submitted version from July 2023, and ran the Action... it worked! (the references appear with ? but I'm not sure if that is a limitation of latexdiff or it needed to run latex on it again to resolve the cite commands) |
I got a zip file and had to unzip it to see the PDF with diff. Not sure if it must be in this way when using GitHub Actions.
I think |
|
Interesting: I got a PDF file when clicking the download icon next to the latexdiff-output. Today I copied the workflow to another repository (and added a feature to compare with a main file of different file name in the past commit). I will ask Copilot about the references issue. Cool idea no? |
Adds a
workflow_dispatchworkflow that generates a PDF showing differences between the current LaTeX document and a previous version usinglatexdiff.Implementation
.github/workflows/latexdiff.ymlcompare_withparameter (tag/commit, defaults to latest tag)fetch-depth: 0)latexdiff --flattento compare old and current versions ofmain.texincluding all\inputfiles (introduction.tex, methods.tex, etc.)pdflatexUsage
Navigate to Actions → "LaTeX Diff" → "Run workflow". Optionally specify a tag/commit to compare against. Download the generated diff PDF from workflow artifacts.
Security
Workflow includes explicit
permissions: contents: readfollowing least-privilege principle.Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.