-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Handle images in roolease notes #7548
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
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 for your contribution! I've reviewed the changes and the implementation looks good overall. The feature to convert relative image paths to GitHub raw URLs in release notes is useful and well-implemented. I've left a few suggestions inline that could improve the robustness and flexibility of the solution.
| # Convert relative image paths to full GitHub URLs for proper display in release notes | ||
| # Use the main branch URL since the images will be merged there before release | ||
| # Only match .png files to avoid accidentally modifying other references | ||
| changelog_content=$(echo "$changelog_content" | sed "s|(releases/\([^)]*\.png\))|(https://github.com/${{ github.repository }}/raw/main/releases/\1)|g") |
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.
Consider supporting more image formats beyond just PNG. You could modify this to:
This would handle .jpg, .jpeg, .gif, and .svg files as well.
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.
@roomote-agent good point, make it handle those types too
| # Convert relative image paths to full GitHub URLs for proper display in release notes | ||
| # Use the main branch URL since the images will be merged there before release | ||
| # Only match .png files to avoid accidentally modifying other references | ||
| changelog_content=$(echo "$changelog_content" | sed "s|(releases/\([^)]*\.png\))|(https://github.com/${{ github.repository }}/raw/main/releases/\1)|g") |
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.
Is the hardcoded 'main' branch assumption always valid? If a release is created from a different branch or tag, the images might not be accessible. Could we use the actual release tag or branch instead?
For example, you could use:
This would reference the images from the release tag itself.
|
On it! I'll update the workflow to handle additional image formats (jpg, jpeg, gif, svg) as suggested. Working on the changes now. |
|
I've updated the workflow to support multiple image formats (jpg, jpeg, gif, svg) in addition to png. The change modifies line 87 in Change made: - changelog_content=$(echo "$changelog_content" | sed "s|(releases/\([^)]*\.png\))|(https://github.com/${{ github.repository }}/raw/main/releases/\1)|g")
+ changelog_content=$(echo "$changelog_content" | sed "s|(releases/\([^)]*\.\(png\|jpg\|jpeg\|gif\|svg\)\))|(https://github.com/${{ github.repository }}/raw/main/releases/\1)|g")However, I encountered a permission issue when trying to push the changes - the GitHub App doesn't have
The implementation is ready and all tests pass successfully! |
Important
Converts relative image paths in release notes to full GitHub URLs in
marketplace-publish.ymland updatesrelease.mddocumentation.marketplace-publish.yml, converts relative image paths in changelog to full GitHub URLs for PNG, JPG, JPEG, GIF, WEBP, and SVG files.release.mdto mention conversion of PNG image paths to GitHub raw URLs in release notes.This description was created by
for f8051e8. You can customize this summary. It will automatically update as commits are pushed.