ci: read the commit message from env in the doc-only check - #1170
Open
kobihikri wants to merge 1 commit into
Open
ci: read the commit message from env in the doc-only check#1170kobihikri wants to merge 1 commit into
kobihikri wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, and thanks for PDFMathTranslate.
In
.github/workflows/python-publish.yml, the "Check if commit is doc-only" step reads the commit message by interpolation:Actions expands
${{ ... }}into the script text before bash runs, so the commit message becomes part of the command rather than input toecho. A commit message is free text — it comes in with whatever a contributor wrote in the PR they got merged — and$(...)and backticks still run inside double quotes.This is the "Test and Release" workflow, which is why I thought it worth raising rather than leaving be. It is
on: pushtomain/master, so a message only gets here after someone merged it, and the reviewer is looking at the diff rather than the commit text.The change reads the message from the environment:
I used
printf '%s'rather thanechoso a message beginning with something like-nis not treated as a flag; thehead -n 1and bothdoc:/doc(prefix tests are unchanged, so doc-only detection behaves exactly as before.The same line appears in
fork-test.yml. I have kept this PR topython-publish.ymlso it stays easy to review, and I am happy to send the same change for the other one if you would like it.Disclosure: I used AI assistance to help spot this and prepare the change, and I read both workflows myself.