Skip to content
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

Provide actions badge svgs #27187

Closed
wants to merge 1 commit into from
Closed

Conversation

lunny
Copy link
Member

@lunny lunny commented Sep 22, 2023

Fix #23688

@lunny lunny added the type/enhancement An improvement of existing functionality label Sep 22, 2023
@lunny lunny added this to the 1.22.0 milestone Sep 22, 2023
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 22, 2023
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 22, 2023
@lunny lunny requested a review from wolfogre September 22, 2023 03:57
@silverwind
Copy link
Member

silverwind commented Sep 22, 2023

If we could template the SVGs in html/template (I asssume it would be suitable), that would be even more flexible, for example the user could change the name string via a URL argument, if they so desire, but in any case, I can accept the current solution as well.

@silverwind
Copy link
Member

Also, I suggest lowercasing the status text, and likely it should just mirror the 4 commit statuses we currently have in the displayed string.

@silverwind
Copy link
Member

https://github.com/essentialkaos/go-badge seems like a package we could use.

@lunny
Copy link
Member Author

lunny commented Sep 23, 2023

If we could template the SVGs in html/template (I asssume it would be suitable), that would be even more flexible, for example the user could change the name string via a URL argument, if they so desire, but in any case, I can accept the current solution as well.

The current method could use CDN and web browser cache better to reduce possible network requests.

@silverwind
Copy link
Member

silverwind commented Sep 23, 2023

Caching can be achieved with proper cache headers as well even when generating those badges dynamically.

BTW, I would personally short the text to CI: passing, so I guess many people would want to be able to customize the left side text at least.

@puni9869
Copy link
Member

Could you share the screenshots, if applicable?

@lunny
Copy link
Member Author

lunny commented Sep 30, 2023

Could you share the screenshots, if applicable?

There is no screenshots. Only svg files on files changed tab.

@lunny
Copy link
Member Author

lunny commented Oct 3, 2023

Caching can be achieved with proper cache headers as well even when generating those badges dynamically.

BTW, I would personally short the text to CI: passing, so I guess many people would want to be able to customize the left side text at least.

This is only for Gitea Actions but not any other integrated third-party CI/CD system. So use Gitea Actions will not make user confusing but CI maybe.

@silverwind
Copy link
Member

silverwind commented Oct 3, 2023

Checking how GitHub does it, they require the workflow filename in the URL and render the workflow name into the SVG. I guess this would be good to have because because if there are multiple workflows, having all of them show "Gitea Actions" would be very confusing.

Example GitHub badges:



We can put the Gitea icon in them of course.

@silverwind
Copy link
Member

silverwind commented Oct 3, 2023

I think it can not easily templated with golang because the width of the SVG needs to be dynamically set based on text. So I think https://github.com/essentialkaos/go-badge might still be the best option, I think it even supports passing in the logo svg.

@lunny lunny closed this Nov 17, 2023
@lunny lunny deleted the lunny/actions_badge branch November 17, 2023 07:18
@GiteaBot GiteaBot removed this from the 1.22.0 milestone Nov 17, 2023
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Feb 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add badge for Gitea Actions to display result in README.md
4 participants