Skip to content

Commit

Permalink
Merge pull request #10 from datarootsio/hypnotoad
Browse files Browse the repository at this point in the history
hypnotoad
  • Loading branch information
bart6114 authored Jul 31, 2023
2 parents 2cf06d0 + a65bfb3 commit 98a9f65
Show file tree
Hide file tree
Showing 17 changed files with 307 additions and 70 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
- retro-print
- terminal-green
- tropical-sunset
- hypnotoad
- a-colibri-hums-while-the-dog-farts
- grainy-dreams
steps:
Expand All @@ -52,14 +53,14 @@ jobs:
- uses: ./
name: github-stats-card
with:
username: bart6114
username: murilo-cunha
gh_token_stats: ${{ env.GITHUB_TOKEN_STATS }}
gh_token_commits: ${{ secrets.GITHUB_TOKEN }}
badge_path: assets/badge-${{ matrix.theme }}.svg
commit: "false"
exclude_repos: "datarootsio"
exclude_repos_override: "datarootsio/cheek"
theme: ${{ matrix.theme }}
about: "Rust evangelist by day, dog whisperer by night,\nliving life between compile and fetch."

- uses: actions/upload-artifact@v3
with:
name: badges-artifact
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ Want to create your own themes? Check out the `themes/` folder, it rather straig

![](assets/badge-grainy-dreams.svg)

`theme: hypnotoad` 👇

![](assets/badge-hypnotoad.svg)


## Configuration options

`gh_token_stats`: token used for fetching user stats, typically a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) (PAT) with access to your personal and organisation repos
Expand Down
12 changes: 6 additions & 6 deletions assets/badge-a-colibri-hums-while-the-dog-farts.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions assets/badge-cool-lake.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions assets/badge-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions assets/badge-grainy-dreams.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
153 changes: 153 additions & 0 deletions assets/badge-hypnotoad.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions assets/badge-jimmy-goes-fishing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions assets/badge-neko-sleeps.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions assets/badge-pad-and-paper.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions assets/badge-retro-print.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions assets/badge-terminal-green.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions assets/badge-tropical-sunset.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions dist/themes/hypnotoad.yaml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/__tests__/collectStats.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ test('collectStats', async () => {

// expect stargazers to be more than 1000
expect(stats.stargazers).toBeGreaterThan(1000)

// had a bug where stats were based on pat and not specified user
const statsMurillo = await collectStats({ ghToken, username: 'murilo-cunha' })
expect(statsMurillo.followers).not.toBe(stats.followers)
expect(statsMurillo.stargazers).not.toBe(stats.stargazers)
expect(statsMurillo.commits).not.toBe(stats.commits)
}, 10000)

test('collectStatsWithFilter', async () => {
Expand Down
12 changes: 5 additions & 7 deletions src/__tests__/generateSvg.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ if (process.env.GITHUB_TOKEN === undefined) {
const ghToken = process.env.GITHUB_TOKEN

test('generateSVG', async () => {
const stats = await collectStats({ ghToken, username: 'bart6114' })
const username = 'murilo-cunha'
const stats = await collectStats({ ghToken, username })
const svg = await generateSvg(
{
theme: 'grainy-dreams',
about: 'He/him, cheese, dad, data,\nrocks & trails.',
theme: 'hypnotoad',
about: 'Rust evangelist by day, dog whisperer by night,\nliving life between compile and fetch.',
stats,
username: 'bart6114'
username
}
)
// for debugging purposes
Expand All @@ -33,9 +34,6 @@ test('generateSVG', async () => {
const svgDoc: object = parser.parse(svg)
expect(svgDoc).toBeDefined()
expect(svgDoc).toBeInstanceOf(Object)

// eslint-disable-next-line
console.log(svg)
}, 10000)

test('templater', () => {
Expand Down
37 changes: 37 additions & 0 deletions themes/hypnotoad.yaml

Large diffs are not rendered by default.

0 comments on commit 98a9f65

Please sign in to comment.