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

Badge request: stars for github gist #8269

Closed
maratori opened this issue Aug 2, 2022 · 4 comments · Fixed by #8471
Closed

Badge request: stars for github gist #8269

maratori opened this issue Aug 2, 2022 · 4 comments · Fixed by #8471
Labels
good first issue New contributors, join in! service-badge Accepted and actionable changes, features, and bugs

Comments

@maratori
Copy link
Contributor

maratori commented Aug 2, 2022

📋 Description

Please add dynamic badge to show number of stars for github gist (not repo).

Example: GitHub Gist stars

🔗 Data

Looks like need to use GraphQL: https://docs.github.com/en/graphql/reference/objects#gist

{
  user(login: "maratori") {
    gist(name: "47a4d00457a92aa426dbd48a18776322") {
      stargazerCount
    }
  }
}

As far as I understand, it requires authentication.

🎤 Motivation

It'd be great to add this badge into my github profile.

@maratori maratori added the service-badge Accepted and actionable changes, features, and bugs label Aug 2, 2022
@chris48s chris48s added the good first issue New contributors, join in! label Aug 2, 2022
@wisebruiser05

This comment was marked as off-topic.

@notanmay
Copy link
Contributor

hi @chris48s , i would like to work on this issue, can you please elaborate a little bit on how to go on to solve this issue?

@chris48s
Copy link
Member

Our tutorial is at https://github.com/badges/shields/blob/master/doc/TUTORIAL.md That covers most of the basics for adding a new badge and writing tests.

For this specific badge you will need to set your local copy up with a github api token by setting

private:
  gh_token: 'your-token-here'

in config/local.yml.

Because this badge will use a GraphQL query, you will need to write a new service class that extends GithubAuthV4Service. If you have a look at other services which extend GithubAuthV4Service https://github.com/badges/shields/search?q=GithubAuthV4Service you can find some similar examples to crib from.

@notanmay
Copy link
Contributor

okay, i get it, thanks for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue New contributors, join in! service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants