-
Notifications
You must be signed in to change notification settings - Fork 82
[CI] Added job adding preview links #2561
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
Conversation
f45d0fd
to
c47f2fe
Compare
c47f2fe
to
3cf1b26
Compare
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.
I manage to generate the whole link list in one go:
git diff --name-only HEAD "origin/master" | grep -E "^docs\/.*\.md$" | sed -E "s|^docs/(.*)\.md$|- [docs/\1.md](${build_url}\1/)|"
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.
Thank you, this is like magic 😄
I've reworked it a bit to avoid harcoding master
and added a new line as it didn't work in Github Actions (it didn't create a list):
comment=$(git diff --name-only HEAD "origin/$GITHUB_BASE_REF" | grep -E "^docs\/.*\.md$" | sed -E "s|^docs/(.*)\.md$|- [docs/\1.md](${build_url}\1/)\n|")
2c4364a
to
c271bac
Compare
Thank you @adriendupuis for the suggestions, it looks much better now! |
Preview of modified Markdown: no Markdown change to preview. |
Co-authored-by: Adrien Dupuis <[email protected]>
* Applied review suggestion * [TMP] Add change * [TMP] Random change 2 * Fixed hardcoded master * Fix? * Fix? * Removed newline * Refactoring * Revert "[TMP] Add change" This reverts commit d9f9ffd. * Revert "[TMP] Random change 2" This reverts commit baa535d. * Removed file filter from the job * Refined message * Applied review wording suggestion Co-authored-by: Adrien Dupuis <[email protected]> --------- Co-authored-by: Adrien Dupuis <[email protected]>
* Applied review suggestion * [TMP] Add change * [TMP] Random change 2 * Fixed hardcoded master * Fix? * Fix? * Removed newline * Refactoring * Revert "[TMP] Add change" This reverts commit d9f9ffd. * Revert "[TMP] Random change 2" This reverts commit baa535d. * Removed file filter from the job * Refined message * Applied review wording suggestion Co-authored-by: Adrien Dupuis <[email protected]> --------- Co-authored-by: Adrien Dupuis <[email protected]>
Target: master, 4.6, 3.3 and user doc as a follow-up.
Adding a job to automatically generate preview links for all the changed Markdown files, so that we don't have to do this manually. See the comment below.
Option 1: No Markdown changes in the
docs
directoryComment saying "No Markdown changes to preview" (#2561 (comment))
Option 2: Markdown changes
Bot adds a comment with links to all modified previews (without the diff coloring)
Option 3: Too many changes
I've chosen an arbitrary limit of 100 files - we can adjust it if needed. Bot adds a comment that too many files were modified to generate a list of links.