-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize the diff text when there's no change #3036
base: master
Are you sure you want to change the base?
Conversation
If a PR doens't generate a diff (like this change) then the message shouldn't link to any diffs. By making this message explicit it makes reviewing a bit easier.
The PR preview for 1df8a46 is available at theforeman-foreman-documentation-preview-pr-3036.surge.sh The following output files are affected by this PR: |
This suggests it's not working as intended, but the workflow runs after |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely idea. Not sure about the implementation, though :)
echo "No diff compared to the current base" >> pr.md | ||
fi | ||
|
||
if [[ -f diff.patch ]] ; theni |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if [[ -f diff.patch ]] ; theni | |
if [[ -f diff.patch ]] ; then |
echo '[show diff](https://${{ env.PREVIEW_DOMAIN }}/diff.patch)' >> pr.md | ||
fi | ||
|
||
if [[ -f diff.html ]] ; theni |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if [[ -f diff.html ]] ; theni | |
if [[ -f diff.html ]] ; then |
echo "" >> pr.md | ||
echo '[show diff as HTML](https://${{ env.PREVIEW_DOMAIN }}/diff.html)' >> pr.md | ||
|
||
if [[ -f diff.txt ]] ; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if [[ -f diff.txt ]] ; then | |
if [ -f diff.txt ] ; then |
AFAIK, [[ ]]
is for conditional command execution, whereas [ ]
is test
, which is probably what you're trying to do.
If you're using [[ ]]
with an intent, can you please explain why is it better here than [ ]
(test
)?
When testing the implementation appeared to have an issue, so I need to dive into it a bit more. Though perhaps that was in the other repo I was playing with |
If a PR doens't generate a diff (like this change) then the message shouldn't link to any diffs. By making this message explicit it makes reviewing a bit easier.
Please cherry-pick my commits into: