forked from mirrored/github-readme-stats
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33ad0f4ee8 | ||
|
|
26a8a23421 |
@@ -1,4 +1,3 @@
|
||||
themes: themes/index.js
|
||||
doc-translation: docs/*
|
||||
card-i18n: src/translations.js
|
||||
documentation: readme.md
|
||||
|
||||
@@ -23,10 +23,6 @@ jobs:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
|
||||
# Fix the unsafe repo error which was introduced by the CVE-2022-24765 git patches.
|
||||
- name: Fix unsafe repo error
|
||||
run: git config --global --add safe.directory ${{ github.workspace }}
|
||||
|
||||
- name: npm install, generate readme
|
||||
run: |
|
||||
npm ci
|
||||
|
||||
@@ -10,5 +10,3 @@ vercel_token
|
||||
# IDE
|
||||
.vscode
|
||||
*.code-workspace
|
||||
|
||||
.vercel
|
||||
|
||||
+1
-5
@@ -47,11 +47,7 @@ All you need to do is edit the [themes/index.js](./themes/index.js) file and add
|
||||
|
||||
While creating the Pull request to add a new theme **don't forget to add a screenshot of how your theme looks**, you can also test how it looks using custom URL parameters like `title_color`, `icon_color`, `bg_color`, `text_color`, `border_color`
|
||||
|
||||
> **Note**
|
||||
> If you are contributing your theme just because you are using it personally, then you can [customize the looks](./readme.md#customization) of your card with URL params instead.
|
||||
|
||||
> **Note**
|
||||
> If your theme name contains multiple words (ie, hyphenated or underscor-ed theme names), please add two versions of theme: one with hyphens and one with underscores. This is to ensure backward-compatability with when we had hyphens for some themes and underscores for others.
|
||||
> NOTE: If you are contributing your theme just because you are using it personally, then you can [customize the looks](./readme.md#customization) of your card with URL params instead.
|
||||
|
||||
## Any contributions you make will be under the MIT Software License
|
||||
|
||||
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
import statsCard from "./api/index.js";
|
||||
import repoCard from "./api/pin.js";
|
||||
import langCard from "./api/top-langs.js";
|
||||
import wakatimeCard from "./api/wakatime.js";
|
||||
import express from "express";
|
||||
import dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
const app = express();
|
||||
app.listen(process.env.port || 9000);
|
||||
|
||||
app.get("/", statsCard);
|
||||
app.get("/pin", repoCard);
|
||||
app.get("/top-langs", langCard);
|
||||
app.get("/wakatime", wakatimeCard);
|
||||
@@ -80,6 +80,9 @@ Visit <https://indiafightscorona.giveindia.org> and make a small donation to hel
|
||||
|
||||
# Features
|
||||
|
||||
- [Getting Started](#getting-started)
|
||||
- [GitHub Actions](#github-actions-recommended)
|
||||
- [Community Deployment](#community-deployment)
|
||||
- [GitHub Stats Card](#github-stats-card)
|
||||
- [GitHub Extra Pins](#github-extra-pins)
|
||||
- [Top Languages Card](#top-languages-card)
|
||||
@@ -92,21 +95,143 @@ Visit <https://indiafightscorona.giveindia.org> and make a small donation to hel
|
||||
- [Repo Card Exclusive Options](#repo-card-exclusive-options)
|
||||
- [Language Card Exclusive Options](#language-card-exclusive-options)
|
||||
- [Wakatime Card Exclusive Option](#wakatime-card-exclusive-options)
|
||||
- [Deploy Yourself](#deploy-on-your-own)
|
||||
- [On Vercel](#on-vercel)
|
||||
- [On other platforms](#on-other-platforms)
|
||||
- [Deploy Yourself](#deploy-on-your-own-vercel-instance)
|
||||
- [Keep your fork up to date](#keep-your-fork-up-to-date)
|
||||
|
||||
# Getting Started
|
||||
|
||||
# GitHub Stats Card
|
||||
## GitHub Actions (Recommended)
|
||||
|
||||
Copy-paste this into your markdown content, and that is it. Simple!
|
||||
Using GitHub Actions over the community deployment is recommended because it provides more accurate stats and 100% uptime. Simply copy-paste the following into the `/.github/workflows/grs.yml` file in your README repo (`USERNAME/USERNAME`).
|
||||
|
||||
Change the `?username=` value to your GitHub username.
|
||||
```yml
|
||||
name: GitHub Readme Stats
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: 0 * * * *
|
||||
|
||||
jobs:
|
||||
grs:
|
||||
permissions: write-all
|
||||
runs-on: ubuntu-latest
|
||||
name: Generate Stats
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Generate Stats
|
||||
uses: Zo-Bro-23/grs-action@v1
|
||||
id: generate
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
options: 'username=${{ github.repository_owner }}'
|
||||
- name: Push
|
||||
uses: crazy-max/ghaction-github-pages@v3
|
||||
with:
|
||||
target_branch: grs
|
||||
build_dir: grs
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
|
||||
If you want to generate multiple stats, such as top languages, wakatime, etc, you can use the following code.
|
||||
|
||||
```yml
|
||||
name: GitHub Readme Stats
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: 0 * * * *
|
||||
|
||||
jobs:
|
||||
stats:
|
||||
permissions: write-all
|
||||
runs-on: ubuntu-latest
|
||||
name: Stats Card
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Generate Stats
|
||||
uses: Zo-Bro-23/grs-action@v1
|
||||
id: generate
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
options: 'username=${{ github.repository_owner }}'
|
||||
- uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: stats
|
||||
path: grs
|
||||
top-langs:
|
||||
permissions: write-all
|
||||
runs-on: ubuntu-latest
|
||||
name: Top Languages Card
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Generate Top Languages
|
||||
uses: Zo-Bro-23/grs-action@v1
|
||||
id: generate
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
options: 'username=${{ github.repository_owner }}'
|
||||
card: 'top-langs'
|
||||
- uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: top-langs
|
||||
path: grs
|
||||
push:
|
||||
permissions: write-all
|
||||
runs-on: ubuntu-latest
|
||||
name: Push
|
||||
needs: [stats, top-langs]
|
||||
steps:
|
||||
- uses: actions/download-artifact@master
|
||||
with:
|
||||
name: stats
|
||||
path: grs
|
||||
- uses: actions/download-artifact@master
|
||||
with:
|
||||
name: top-langs
|
||||
path: grs
|
||||
- name: Push
|
||||
uses: crazy-max/ghaction-github-pages@v3
|
||||
with:
|
||||
target_branch: grs
|
||||
build_dir: grs
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
|
||||
You can now include the stats in your README by using the following markdown code (replace `USERNAME` with your GitHub username).
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
```
|
||||
|
||||
You can also enable GitHub Pages on the `grs` branch (root) and use that URL (replace `GH_PAGES_URL` with your GitHub Pages URL).
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
```
|
||||
|
||||
The GitHub Action accepts the following inputs:
|
||||
- `token` - `REQUIRED` - Your GitHub Personal Access Token (PAT), or any other token that GitHub accepts.
|
||||
- `options` - `REQUIRED` - Any customization options. More below. (This is the same as the query string you would pass to the API if using the community deployment)
|
||||
- `card` - The type of card to generate. `repo`, `top-langs`, or `wakatime` (leave empty for stats card).
|
||||
- `path` - Output path for SVG file. Relative path; include filename with `.svg`.
|
||||
- `fetch_multipage` - Experimental feature that gives more accurate stats if you have >100 repos.
|
||||
|
||||
## Community Deployment
|
||||
Copy-paste the following markdown code. Change the `?username=` value to your GitHub username.
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
```
|
||||
|
||||
Other cards can be included by using `/api/top-langs`, `/api/pin`, or `/api/wakatime`. More customization options can be added by using query parameters (`&option1=value1&option2=value2&...`).
|
||||
|
||||
# GitHub Stats Card
|
||||
|
||||
> **Note**
|
||||
> Available ranks are S+ (top 1%), S (top 25%), A++ (top 45%), A+ (top 60%), and B+ (everyone). The values are calculated by using the [cumulative distribution function](https://en.wikipedia.org/wiki/Cumulative_distribution_function) using commits, contributions, issues, stars, pull requests, followers, and owned repositories. The implementation can be investigated at [src/calculateRank.js](./src/calculateRank.js).
|
||||
|
||||
@@ -117,7 +242,7 @@ You can pass a query parameter `&hide=` to hide any specific stats with comma-se
|
||||
> Options: `&hide=stars,commits,prs,issues,contribs`
|
||||
|
||||
```md
|
||||

|
||||
?username=anuraghazra&hide=contribs,prs
|
||||
```
|
||||
|
||||
### Adding private contributions count to total commits count
|
||||
@@ -130,15 +255,15 @@ You can add the count of all your private contributions to the total commits cou
|
||||
> Options: `&count_private=true`
|
||||
|
||||
```md
|
||||

|
||||
?username=anuraghazra&count_private=true
|
||||
```
|
||||
|
||||
### Showing icons
|
||||
|
||||
To enable icons, you can pass `&show_icons=true` in the query param, like so:
|
||||
To enable icons, you can pass `show_icons=true` in the query param, like so:
|
||||
|
||||
```md
|
||||

|
||||
?username=anuraghazra&show_icons=true
|
||||
```
|
||||
|
||||
### Themes
|
||||
@@ -148,7 +273,7 @@ With inbuilt themes, you can customize the look of the card without doing any [m
|
||||
Use `&theme=THEME_NAME` parameter like so :
|
||||
|
||||
```md
|
||||

|
||||
?username=anuraghazra&show_icons=true&theme=radical
|
||||
```
|
||||
|
||||
#### All inbuilt themes
|
||||
@@ -171,7 +296,7 @@ Since GitHub will re-upload the cards and serve them from their [CDN](https://do
|
||||
We have included a `transparent` theme that has a transparent background. This theme is optimized to look good on GitHub's dark and light default themes. You can enable this theme using the `&theme=transparent` parameter like so:
|
||||
|
||||
```md
|
||||

|
||||
?username=anuraghazra&show_icons=true&theme=transparent
|
||||
```
|
||||
|
||||
<details>
|
||||
@@ -186,7 +311,7 @@ We have included a `transparent` theme that has a transparent background. This t
|
||||
You can use the `bg_color` parameter to make any of [the available themes](./themes/README.md) transparent. This is done by setting the `bg_color` to a colour with a transparent alpha channel (i.e. `bg_color=00000000`):
|
||||
|
||||
```md
|
||||

|
||||
?username=anuraghazra&show_icons=true&bg_color=00000000
|
||||
```
|
||||
|
||||
<details>
|
||||
@@ -201,8 +326,8 @@ You can use the `bg_color` parameter to make any of [the available themes](./the
|
||||
You can use [GitHub's theme context](https://github.blog/changelog/2021-11-24-specify-theme-context-for-images-in-markdown/) tags to switch the theme based on the user GitHub theme automatically. This is done by appending `#gh-dark-mode-only` or `#gh-light-mode-only` to the end of an image URL. This tag will define whether the image specified in the markdown is only shown to viewers using a light or a dark GitHub theme:
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats#gh-dark-mode-only)
|
||||
[](https://github.com/anuraghazra/github-readme-stats#gh-light-mode-only)
|
||||
[](https://github.com/anuraghazra/github-readme-stats#gh-dark-mode-only)
|
||||
[](https://github.com/anuraghazra/github-readme-stats#gh-light-mode-only)
|
||||
```
|
||||
|
||||
<details>
|
||||
@@ -220,14 +345,14 @@ You can use [GitHub's new media feature](https://github.blog/changelog/2022-05-1
|
||||
```html
|
||||
<picture>
|
||||
<source
|
||||
srcset="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark"
|
||||
srcset="https://DARK_SVG_URL/"
|
||||
media="(prefers-color-scheme: dark)"
|
||||
/>
|
||||
<source
|
||||
srcset="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true"
|
||||
srcset="https://LIGHT_SVG_URL/"
|
||||
media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)"
|
||||
/>
|
||||
<img src="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true" />
|
||||
<img src="https://DEFAULT_SVG_URL/" />
|
||||
</picture>
|
||||
```
|
||||
|
||||
@@ -250,7 +375,7 @@ You can use [GitHub's new media feature](https://github.blog/changelog/2022-05-1
|
||||
|
||||
### Customization
|
||||
|
||||
You can customize the appearance of your `Stats Card` or `Repo Card` however you wish with URL parameters.
|
||||
You can customize the appearance of your cards however you wish with these parameters.
|
||||
|
||||
#### Common Options
|
||||
|
||||
@@ -266,7 +391,7 @@ You can customize the appearance of your `Stats Card` or `Repo Card` however you
|
||||
- `border_radius` - Corner rounding on the card. Default: `4.5`.
|
||||
|
||||
> **Warning**
|
||||
> We use caching to decrease the load on our servers (see <https://github.com/anuraghazra/github-readme-stats/issues/1471#issuecomment-1271551425>). Our cards have a default cache of 4 hours (14400 seconds). Also, note that the cache is clamped to a minimum of 4 hours and a maximum of 24 hours.
|
||||
> We use caching to decrease the load on our servers (see <https://github.com/anuraghazra/github-readme-stats/issues/1471#issuecomment-1271551425>). Our cards have a default cache of 4 hours (14400 seconds). Also, note that the cache is clamped to a minimum of 4 hours and a maximum of 24 hours. This is why we recommend using our GitHub Action :)
|
||||
|
||||
##### Gradient in bg_color
|
||||
|
||||
@@ -336,13 +461,7 @@ Yay! You are no longer limited to 6 pinned repositories.
|
||||
|
||||
### Usage
|
||||
|
||||
Copy-paste this code into your readme and change the links.
|
||||
|
||||
Endpoint: `api/pin?username=anuraghazra&repo=github-readme-stats`
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
```
|
||||
Use the `api/pin` endpoint with the API or the `card: 'repo'` option with the GitHub Action.
|
||||
|
||||
### Demo
|
||||
|
||||
@@ -357,24 +476,18 @@ Use [show_owner](#customization) variable to include the repo's owner username
|
||||
The top languages card shows a GitHub user's most frequently used top language.
|
||||
|
||||
> **Note**
|
||||
> Top Languages does not indicate my skill level or anything like that; it's a GitHub metric to determine which languages have the most code on GitHub. It is a new feature of github-readme-stats.
|
||||
> Top Languages does not indicate skill level or anything like that; it's a GitHub metric to determine which languages have the most code on GitHub.
|
||||
|
||||
### Usage
|
||||
|
||||
Copy-paste this code into your readme and change the links.
|
||||
|
||||
Endpoint: `api/top-langs?username=anuraghazra`
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
```
|
||||
Use the `api/top-langs` endpoint with the API or the `card: 'top-langs'` option with the GitHub Action.
|
||||
|
||||
### Exclude individual repositories
|
||||
|
||||
You can use the `&exclude_repo=repo1,repo2` parameter to exclude individual repositories.
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
?username=anuraghazra&exclude_repo=github-readme-stats,anuraghazra.github.io
|
||||
```
|
||||
|
||||
### Hide individual languages
|
||||
@@ -382,7 +495,7 @@ You can use the `&exclude_repo=repo1,repo2` parameter to exclude individual repo
|
||||
You can use `&hide=language1,language2` parameter to hide individual languages.
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
?username=anuraghazra&hide=javascript,html
|
||||
```
|
||||
|
||||
### Show more languages
|
||||
@@ -390,7 +503,7 @@ You can use `&hide=language1,language2` parameter to hide individual languages.
|
||||
You can use the `&langs_count=` option to increase or decrease the number of languages shown on the card. Valid values are integers between 1 and 10 (inclusive), and the default is 5.
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
?username=anuraghazra&langs_count=8
|
||||
```
|
||||
|
||||
### Compact Language Card Layout
|
||||
@@ -398,7 +511,7 @@ You can use the `&langs_count=` option to increase or decrease the number of lan
|
||||
You can use the `&layout=compact` option to change the card design.
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
?username=anuraghazra&layout=compact
|
||||
```
|
||||
|
||||
### Hide Progress Bars
|
||||
@@ -406,7 +519,7 @@ You can use the `&layout=compact` option to change the card design.
|
||||
You can use the `&hide_progress=true` option to hide the percentages and the progress bars (layout will be automatically set to `compact`).
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
?username=anuraghazra&hide_progress=true
|
||||
```
|
||||
|
||||
### Demo
|
||||
@@ -423,15 +536,27 @@ You can use the `&hide_progress=true` option to hide the percentages and the pro
|
||||
|
||||
# Wakatime Week Stats
|
||||
|
||||
### Usage
|
||||
|
||||
Use the `api/wkatime` endpoint with the API or the `card: 'wakatime'` option with the GitHub Action.
|
||||
|
||||
Change the `?username=` value to your [Wakatime](https://wakatime.com) username.
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
?username=willianrod
|
||||
```
|
||||
|
||||
> **Note**:
|
||||
> Please be aware that we currently only show data from Wakatime profiles that are public.
|
||||
|
||||
### Compact Wakatime Card Layout
|
||||
|
||||
You can use the `&layout=compact` option to change the card design.
|
||||
|
||||
```md
|
||||
?username=willianrod&layout=compact
|
||||
```
|
||||
|
||||
### Demo
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
@@ -504,16 +629,14 @@ By default, GitHub does not lay out the cards side by side. To do that, you can
|
||||
|
||||
```html
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats">
|
||||
<img align="center" src="https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats" />
|
||||
<img align="center" src="https://SVG_URL/" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/convoychat">
|
||||
<img align="center" src="https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=convoychat" />
|
||||
<img align="center" src="https://SVG_URL/" />
|
||||
</a>
|
||||
```
|
||||
|
||||
## Deploy on your own
|
||||
|
||||
### On Vercel
|
||||
## Deploy your own Vercel instance
|
||||
|
||||
#### :film_projector: [Check Out Step By Step Video Tutorial By @codeSTACKr](https://youtu.be/n6d4KHSKqGk?t=107)
|
||||
|
||||
@@ -550,26 +673,9 @@ Since the GitHub API only allows 5k requests per hour, my `https://github-readme
|
||||
|
||||
</details>
|
||||
|
||||
### On other platforms
|
||||
|
||||
> **Warning**
|
||||
> This way of using GRS is not officially supported and was added to cater to some particular use cases where Vercel could not be used (e.g. #2341). The support for this method, therefore, is limited.
|
||||
|
||||
<details>
|
||||
<summary><b>:hammer_and_wrench: Step-by-step guide for deploying on other platforms</b></summary>
|
||||
|
||||
1. Fork or clone this repo as per your needs
|
||||
2. Add `express` to the dependencies section of `package.json`
|
||||
https://github.com/anuraghazra/github-readme-stats/blob/ba7c2f8b55eac8452e479c8bd38b044d204d0424/package.json#L54-L61
|
||||
3. Run `npm i` if needed (initial setup)
|
||||
4. Run `node express.js` to start the server, or set the entry point to `express.js` in `package.json` if you're deploying on a managed service
|
||||
https://github.com/anuraghazra/github-readme-stats/blob/ba7c2f8b55eac8452e479c8bd38b044d204d0424/package.json#L11
|
||||
5. You're done 🎉
|
||||
</details>
|
||||
|
||||
### Keep your fork up to date
|
||||
|
||||
You can keep your fork, and thus your private Vercel instance up to date with the upstream using GitHubs' [Sync Fork button](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork). You can also use the [pull](https://github.com/wei/pull) package created by [@wei](https://github.com/wei) to automate this process.
|
||||
You can keep your fork, and thus your private Vercel instance up to date with the upstream using GitHub's [Sync Fork button](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork). You can also use the [pull](https://github.com/wei/pull) package created by [@wei](https://github.com/wei) to automate this process.
|
||||
|
||||
## :sparkling_heart: Support the project
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ const createStatMdLink = (theme) => {
|
||||
const generateLinks = (fn) => {
|
||||
return Object.keys(themes)
|
||||
.map((name) => fn(name))
|
||||
.filter((name) => !name.includes('-'))
|
||||
.join("");
|
||||
};
|
||||
|
||||
@@ -68,7 +67,7 @@ const generateTable = ({ isRepoCard }) => {
|
||||
const rows = [];
|
||||
const themesFiltered = Object.keys(themes).filter(
|
||||
(name) => name !== (!isRepoCard ? "default_repocard" : "default"),
|
||||
).filter((name) => !name.includes('-'));
|
||||
);
|
||||
|
||||
for (let i = 0; i < themesFiltered.length; i += 3) {
|
||||
const one = themesFiltered[i];
|
||||
|
||||
@@ -298,13 +298,12 @@ const themeNameAlreadyExists = (name) => {
|
||||
return themes[name] !== undefined;
|
||||
};
|
||||
|
||||
const DRY_RUN = process.env.DRY_RUN === "true" || false;
|
||||
|
||||
/**
|
||||
* Main function.
|
||||
*/
|
||||
export const run = async (prNumber) => {
|
||||
try {
|
||||
const dryRun = process.env.DRY_RUN === "true" || false;
|
||||
debug("Retrieve action information from context...");
|
||||
debug(`Context: ${inspect(github.context)}`);
|
||||
let commentBody = `
|
||||
@@ -514,7 +513,7 @@ export const run = async (prNumber) => {
|
||||
// Create or update theme-preview comment.
|
||||
debug("Create or update theme-preview comment...");
|
||||
let comment_url;
|
||||
if (!DRY_RUN) {
|
||||
if (!dryRun) {
|
||||
comment_url = await upsertComment(octokit, {
|
||||
comment_id: comment?.id,
|
||||
issue_number: pullRequestId,
|
||||
@@ -536,7 +535,7 @@ export const run = async (prNumber) => {
|
||||
const reviewReason = themesValid
|
||||
? undefined
|
||||
: INVALID_REVIEW_COMMENT(comment_url);
|
||||
if (!DRY_RUN) {
|
||||
if (!dryRun) {
|
||||
await addReview(
|
||||
octokit,
|
||||
pullRequestId,
|
||||
@@ -559,7 +558,7 @@ export const run = async (prNumber) => {
|
||||
}
|
||||
} catch (error) {
|
||||
debug("Set review state to `REQUEST_CHANGES` and add `invalid` label...");
|
||||
if (!DRY_RUN) {
|
||||
if (!dryRun) {
|
||||
await addReview(
|
||||
octokit,
|
||||
pullRequestId,
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
import { langCardLocales } from "../translations.js";
|
||||
|
||||
const DEFAULT_CARD_WIDTH = 300;
|
||||
const MIN_CARD_WIDTH = 280;
|
||||
const MIN_CARD_WIDTH = 230;
|
||||
const DEFAULT_LANGS_COUNT = 5;
|
||||
const DEFAULT_LANG_COLOR = "#858585";
|
||||
const CARD_PADDING = 25;
|
||||
@@ -317,6 +317,7 @@ const renderTopLanguages = (topLangs, options = {}) => {
|
||||
|
||||
let finalLayout = "";
|
||||
if (layout === "compact" || hide_progress == true) {
|
||||
width = width + 50; // padding
|
||||
height =
|
||||
calculateCompactLayoutHeight(langs.length) + (hide_progress ? -25 : 0);
|
||||
|
||||
|
||||
@@ -118,7 +118,6 @@ const createTextNode = ({
|
||||
// @ts-ignore
|
||||
name: label,
|
||||
progressBarBackgroundColor,
|
||||
delay: staggerDelay + 300,
|
||||
});
|
||||
|
||||
return `
|
||||
@@ -277,12 +276,11 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
|
||||
} else {
|
||||
finalLayout = flexLayout({
|
||||
items: filteredLanguages.length
|
||||
? filteredLanguages.map((language, index) => {
|
||||
? filteredLanguages.map((language) => {
|
||||
return createTextNode({
|
||||
id: language.name,
|
||||
label: language.name,
|
||||
value: language.text,
|
||||
index: index,
|
||||
percent: language.percent,
|
||||
// @ts-ignore
|
||||
progressBarColor: titleColor,
|
||||
@@ -323,29 +321,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
|
||||
card.setCSS(
|
||||
`
|
||||
${cssStyles}
|
||||
@keyframes slideInAnimation {
|
||||
from {
|
||||
width: 0;
|
||||
}
|
||||
to {
|
||||
width: calc(100%-100px);
|
||||
}
|
||||
}
|
||||
@keyframes growWidthAnimation {
|
||||
from {
|
||||
width: 0;
|
||||
}
|
||||
to {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: ${textColor} }
|
||||
#rect-mask rect{
|
||||
animation: slideInAnimation 1s ease-in-out forwards;
|
||||
}
|
||||
.lang-progress{
|
||||
animation: growWidthAnimation 0.6s ease-in-out forwards;
|
||||
}
|
||||
`,
|
||||
);
|
||||
|
||||
|
||||
@@ -79,7 +79,6 @@
|
||||
"Ceylon": "#dfa535",
|
||||
"Chapel": "#8dc63f",
|
||||
"ChucK": "#3f8000",
|
||||
"Circom": "#707575",
|
||||
"Cirru": "#ccccff",
|
||||
"Clarion": "#db901e",
|
||||
"Clarity": "#5546ff",
|
||||
@@ -117,7 +116,6 @@
|
||||
"DirectX 3D File": "#aace60",
|
||||
"Dockerfile": "#384d54",
|
||||
"Dogescript": "#cca760",
|
||||
"Dotenv": "#e5d559",
|
||||
"Dylan": "#6c616e",
|
||||
"E": "#ccce35",
|
||||
"ECL": "#8a1267",
|
||||
@@ -151,7 +149,7 @@
|
||||
"Forth": "#341708",
|
||||
"Fortran": "#4d41b1",
|
||||
"Fortran Free Form": "#4d41b1",
|
||||
"FreeBasic": "#141AC9",
|
||||
"FreeBasic": "#867db1",
|
||||
"FreeMarker": "#0050b2",
|
||||
"Frege": "#00cafe",
|
||||
"Futhark": "#5f021f",
|
||||
@@ -184,7 +182,6 @@
|
||||
"Go": "#00ADD8",
|
||||
"Go Checksums": "#00ADD8",
|
||||
"Go Module": "#00ADD8",
|
||||
"Godot Resource": "#355570",
|
||||
"Golo": "#88562A",
|
||||
"Gosu": "#82937f",
|
||||
"Grace": "#615f8b",
|
||||
@@ -195,7 +192,6 @@
|
||||
"Groovy": "#4298b8",
|
||||
"Groovy Server Pages": "#4298b8",
|
||||
"HAProxy": "#106da9",
|
||||
"HCL": "#844FBA",
|
||||
"HLSL": "#aace60",
|
||||
"HOCON": "#9ff8ee",
|
||||
"HTML": "#e34c26",
|
||||
@@ -229,7 +225,6 @@
|
||||
"Isabelle ROOT": "#FEFE00",
|
||||
"J": "#9EEDFF",
|
||||
"JAR Manifest": "#b07219",
|
||||
"JCL": "#d90e09",
|
||||
"JFlex": "#DBCA00",
|
||||
"JSON": "#292929",
|
||||
"JSON with Comments": "#292929",
|
||||
@@ -252,11 +247,9 @@
|
||||
"Jsonnet": "#0064bd",
|
||||
"Julia": "#a270ba",
|
||||
"Jupyter Notebook": "#DA5B0B",
|
||||
"Just": "#384d54",
|
||||
"KRL": "#28430A",
|
||||
"Kaitai Struct": "#773b37",
|
||||
"KakouneScript": "#6f8042",
|
||||
"KerboScript": "#41adf0",
|
||||
"KiCad Layout": "#2f4aab",
|
||||
"KiCad Legacy Layout": "#2f4aab",
|
||||
"KiCad Schematic": "#2f4aab",
|
||||
@@ -369,7 +362,6 @@
|
||||
"PicoLisp": "#6067af",
|
||||
"PigLatin": "#fcd7de",
|
||||
"Pike": "#005390",
|
||||
"PlantUML": "#fbbd16",
|
||||
"PogoScript": "#d80074",
|
||||
"Polar": "#ae81ff",
|
||||
"Portugol": "#f8bd00",
|
||||
@@ -387,7 +379,6 @@
|
||||
"Puppet": "#302B6D",
|
||||
"PureBasic": "#5a6986",
|
||||
"PureScript": "#1D222D",
|
||||
"Pyret": "#ee1e10",
|
||||
"Python": "#3572A5",
|
||||
"Python console": "#3572A5",
|
||||
"Python traceback": "#3572A5",
|
||||
@@ -540,6 +531,7 @@
|
||||
"fish": "#4aae47",
|
||||
"hoon": "#00b171",
|
||||
"jq": "#c7254e",
|
||||
"just": "#384d54",
|
||||
"kvlang": "#1da6e0",
|
||||
"mIRC Script": "#3d57c3",
|
||||
"mcfunction": "#E22837",
|
||||
|
||||
@@ -69,29 +69,7 @@ exports[`Test Render Wakatime Card should render correctly with compact layout 1
|
||||
}
|
||||
|
||||
|
||||
@keyframes slideInAnimation {
|
||||
from {
|
||||
width: 0;
|
||||
}
|
||||
to {
|
||||
width: calc(100%-100px);
|
||||
}
|
||||
}
|
||||
@keyframes growWidthAnimation {
|
||||
from {
|
||||
width: 0;
|
||||
}
|
||||
to {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58 }
|
||||
#rect-mask rect{
|
||||
animation: slideInAnimation 1s ease-in-out forwards;
|
||||
}
|
||||
.lang-progress{
|
||||
animation: growWidthAnimation 0.6s ease-in-out forwards;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -249,29 +227,7 @@ exports[`Test Render Wakatime Card should render correctly with compact layout w
|
||||
}
|
||||
|
||||
|
||||
@keyframes slideInAnimation {
|
||||
from {
|
||||
width: 0;
|
||||
}
|
||||
to {
|
||||
width: calc(100%-100px);
|
||||
}
|
||||
}
|
||||
@keyframes growWidthAnimation {
|
||||
from {
|
||||
width: 0;
|
||||
}
|
||||
to {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58 }
|
||||
#rect-mask rect{
|
||||
animation: slideInAnimation 1s ease-in-out forwards;
|
||||
}
|
||||
.lang-progress{
|
||||
animation: growWidthAnimation 0.6s ease-in-out forwards;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -15,14 +15,14 @@ const REPO = "curly-fiesta";
|
||||
const USER = "catelinemnemosyne";
|
||||
const STATS_DATA = {
|
||||
name: "Cateline Mnemosyne",
|
||||
totalPRs: 2,
|
||||
totalCommits: 8,
|
||||
totalPRs: 1,
|
||||
totalCommits: 7,
|
||||
totalIssues: 1,
|
||||
totalStars: 1,
|
||||
contributedTo: 1,
|
||||
rank: {
|
||||
level: "A+",
|
||||
score: 50.88831151384285,
|
||||
score: 50.893750297869225,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ describe("Test renderTopLanguages", () => {
|
||||
);
|
||||
expect(queryAllByTestId(document.body, "lang-progress")[0]).toHaveAttribute(
|
||||
"width",
|
||||
"100",
|
||||
"120",
|
||||
);
|
||||
|
||||
expect(queryAllByTestId(document.body, "lang-name")[1]).toHaveTextContent(
|
||||
@@ -224,7 +224,7 @@ describe("Test renderTopLanguages", () => {
|
||||
);
|
||||
expect(queryAllByTestId(document.body, "lang-progress")[1]).toHaveAttribute(
|
||||
"width",
|
||||
"100",
|
||||
"120",
|
||||
);
|
||||
|
||||
expect(queryAllByTestId(document.body, "lang-name")[2]).toHaveTextContent(
|
||||
@@ -232,7 +232,7 @@ describe("Test renderTopLanguages", () => {
|
||||
);
|
||||
expect(queryAllByTestId(document.body, "lang-progress")[2]).toHaveAttribute(
|
||||
"width",
|
||||
"50",
|
||||
"60",
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
-167
@@ -12,12 +12,6 @@ export const themes = {
|
||||
text_color: "434d58",
|
||||
bg_color: "fffefe",
|
||||
},
|
||||
"default-repocard": {
|
||||
title_color: "2f80ed",
|
||||
icon_color: "586069", // icon color is different
|
||||
text_color: "434d58",
|
||||
bg_color: "fffefe",
|
||||
},
|
||||
transparent: {
|
||||
title_color: "006AFF",
|
||||
icon_color: "0579C3",
|
||||
@@ -54,12 +48,6 @@ export const themes = {
|
||||
text_color: "427b58",
|
||||
bg_color: "fbf1c7",
|
||||
},
|
||||
"gruvbox-light": {
|
||||
title_color: "b57614",
|
||||
icon_color: "af3a03",
|
||||
text_color: "427b58",
|
||||
bg_color: "fbf1c7",
|
||||
},
|
||||
tokyonight: {
|
||||
title_color: "70a5fd",
|
||||
icon_color: "bf91f3",
|
||||
@@ -120,24 +108,12 @@ export const themes = {
|
||||
text_color: "fffefe",
|
||||
bg_color: "273849",
|
||||
},
|
||||
vue_dark: {
|
||||
title_color: "41b883",
|
||||
icon_color: "41b883",
|
||||
text_color: "fffefe",
|
||||
bg_color: "273849",
|
||||
},
|
||||
"shades-of-purple": {
|
||||
title_color: "fad000",
|
||||
icon_color: "b362ff",
|
||||
text_color: "a599e9",
|
||||
bg_color: "2d2b55",
|
||||
},
|
||||
shades_of_purple: {
|
||||
title_color: "fad000",
|
||||
icon_color: "b362ff",
|
||||
text_color: "a599e9",
|
||||
bg_color: "2d2b55",
|
||||
},
|
||||
nightowl: {
|
||||
title_color: "c792ea",
|
||||
icon_color: "ffeb95",
|
||||
@@ -156,12 +132,6 @@ export const themes = {
|
||||
text_color: "0cf574",
|
||||
bg_color: "040f0f",
|
||||
},
|
||||
blue_green: {
|
||||
title_color: "2f97c1",
|
||||
icon_color: "f5b700",
|
||||
text_color: "0cf574",
|
||||
bg_color: "040f0f",
|
||||
},
|
||||
algolia: {
|
||||
title_color: "00AEFF",
|
||||
icon_color: "2DDE98",
|
||||
@@ -174,12 +144,6 @@ export const themes = {
|
||||
text_color: "ffd95b",
|
||||
bg_color: "000000",
|
||||
},
|
||||
great_gatsby: {
|
||||
title_color: "ffa726",
|
||||
icon_color: "ffb74d",
|
||||
text_color: "ffd95b",
|
||||
bg_color: "000000",
|
||||
},
|
||||
darcula: {
|
||||
title_color: "BA5F17",
|
||||
icon_color: "84628F",
|
||||
@@ -210,24 +174,6 @@ export const themes = {
|
||||
text_color: "fff",
|
||||
bg_color: "000",
|
||||
},
|
||||
solarized_dark: {
|
||||
title_color: "268bd2",
|
||||
icon_color: "b58900",
|
||||
text_color: "859900",
|
||||
bg_color: "002b36",
|
||||
},
|
||||
solarized_light: {
|
||||
title_color: "268bd2",
|
||||
icon_color: "b58900",
|
||||
text_color: "859900",
|
||||
bg_color: "fdf6e3",
|
||||
},
|
||||
chartreuse_dark: {
|
||||
title_color: "7fff00",
|
||||
icon_color: "00AEFF",
|
||||
text_color: "fff",
|
||||
bg_color: "000",
|
||||
},
|
||||
nord: {
|
||||
title_color: "81a1c1",
|
||||
text_color: "d8dee9",
|
||||
@@ -246,12 +192,6 @@ export const themes = {
|
||||
text_color: "a6accd",
|
||||
bg_color: "292d3e",
|
||||
},
|
||||
material_palenight: {
|
||||
title_color: "c792ea",
|
||||
icon_color: "89ddff",
|
||||
text_color: "a6accd",
|
||||
bg_color: "292d3e",
|
||||
},
|
||||
graywhite: {
|
||||
title_color: "24292e",
|
||||
icon_color: "24292e",
|
||||
@@ -276,24 +216,6 @@ export const themes = {
|
||||
text_color: "ffffff",
|
||||
bg_color: "000000",
|
||||
},
|
||||
vision_friendly_dark: {
|
||||
title_color: "ffb000",
|
||||
icon_color: "785ef0",
|
||||
text_color: "ffffff",
|
||||
bg_color: "000000",
|
||||
},
|
||||
ayu_mirage: {
|
||||
title_color: "f4cd7c",
|
||||
icon_color: "73d0ff",
|
||||
text_color: "c7c8c2",
|
||||
bg_color: "1f2430",
|
||||
},
|
||||
midnight_purple: {
|
||||
title_color: "9745f5",
|
||||
icon_color: "9f4bff",
|
||||
text_color: "ffffff",
|
||||
bg_color: "000000",
|
||||
},
|
||||
calm: {
|
||||
title_color: "e07a5f",
|
||||
icon_color: "edae49",
|
||||
@@ -306,12 +228,6 @@ export const themes = {
|
||||
text_color: "509E2F",
|
||||
bg_color: "ffffff",
|
||||
},
|
||||
flag_india: {
|
||||
title_color: "ff8f1c",
|
||||
icon_color: "250E62",
|
||||
text_color: "509E2F",
|
||||
bg_color: "ffffff",
|
||||
},
|
||||
omni: {
|
||||
title_color: "FF79C6",
|
||||
icon_color: "e7de79",
|
||||
@@ -360,12 +276,6 @@ export const themes = {
|
||||
text_color: "d9c8a9",
|
||||
bg_color: "402b23",
|
||||
},
|
||||
"kacho-ga": {
|
||||
title_color: "bf4a3f",
|
||||
icon_color: "a64833",
|
||||
text_color: "d9c8a9",
|
||||
bg_color: "402b23",
|
||||
},
|
||||
outrun: {
|
||||
title_color: "ffcc00",
|
||||
icon_color: "ff1aff",
|
||||
@@ -384,18 +294,6 @@ export const themes = {
|
||||
text_color: "718CA1",
|
||||
bg_color: "1D252C",
|
||||
},
|
||||
"ocean-dark": {
|
||||
title_color: "8957B2",
|
||||
icon_color: "FFFFFF",
|
||||
text_color: "92D534",
|
||||
bg_color: "151A28",
|
||||
},
|
||||
"city-lights": {
|
||||
title_color: "5D8CB3",
|
||||
icon_color: "4798FF",
|
||||
text_color: "718CA1",
|
||||
bg_color: "1D252C",
|
||||
},
|
||||
github_dark: {
|
||||
title_color: "58A6FF",
|
||||
icon_color: "1F6FEB",
|
||||
@@ -414,24 +312,6 @@ export const themes = {
|
||||
text_color: "dbdbdb",
|
||||
bg_color: "252334",
|
||||
},
|
||||
"github-dark": {
|
||||
title_color: "58A6FF",
|
||||
icon_color: "1F6FEB",
|
||||
text_color: "C3D1D9",
|
||||
bg_color: "0D1117",
|
||||
},
|
||||
"discord-old-blurple": {
|
||||
title_color: "7289DA",
|
||||
icon_color: "7289DA",
|
||||
text_color: "FFFFFF",
|
||||
bg_color: "2C2F33",
|
||||
},
|
||||
"aura-dark": {
|
||||
title_color: "ff7372",
|
||||
icon_color: "6cffd0",
|
||||
text_color: "dbdbdb",
|
||||
bg_color: "252334",
|
||||
},
|
||||
panda: {
|
||||
title_color: "19f9d899",
|
||||
icon_color: "19f9d899",
|
||||
@@ -444,12 +324,6 @@ export const themes = {
|
||||
text_color: "c5cdd3",
|
||||
bg_color: "1b2932",
|
||||
},
|
||||
"noctis-minimus": {
|
||||
title_color: "d3b692",
|
||||
icon_color: "72b7c0",
|
||||
text_color: "c5cdd3",
|
||||
bg_color: "1b2932",
|
||||
},
|
||||
cobalt2: {
|
||||
title_color: "ffc600",
|
||||
icon_color: "ffffff",
|
||||
@@ -500,33 +374,6 @@ export const themes = {
|
||||
border_color: "170F0C",
|
||||
bg_color: "170F0C",
|
||||
},
|
||||
one_dark_pro: {
|
||||
title_color: "61AFEF",
|
||||
text_color: "E5C06E",
|
||||
icon_color: "C678DD",
|
||||
border_color: "3B4048",
|
||||
bg_color: "23272E",
|
||||
},
|
||||
"rose-pine": {
|
||||
title_color: "9ccfd8",
|
||||
icon_color: "ebbcba",
|
||||
text_color: "e0def4",
|
||||
bg_color: "191724",
|
||||
},
|
||||
"date-night": {
|
||||
title_color: "DA7885",
|
||||
text_color: "E1B2A2",
|
||||
icon_color: "BB8470",
|
||||
border_color: "170F0C",
|
||||
bg_color: "170F0C",
|
||||
},
|
||||
"one-dark-pro": {
|
||||
title_color: "61AFEF",
|
||||
text_color: "E5C06E",
|
||||
icon_color: "C678DD",
|
||||
border_color: "3B4048",
|
||||
bg_color: "23272E",
|
||||
},
|
||||
rose: {
|
||||
title_color: "8d192b",
|
||||
text_color: "862931",
|
||||
@@ -534,20 +381,6 @@ export const themes = {
|
||||
border_color: "e9d8d4",
|
||||
bg_color: "e9d8d4",
|
||||
},
|
||||
holi_theme: {
|
||||
title_color: "5FABEE",
|
||||
text_color: "D6E7FF",
|
||||
icon_color: "5FABEE",
|
||||
border_color: "85A4C0",
|
||||
bg_color: "030314",
|
||||
},
|
||||
"holi-theme": {
|
||||
title_color: "5FABEE",
|
||||
text_color: "D6E7FF",
|
||||
icon_color: "5FABEE",
|
||||
border_color: "85A4C0",
|
||||
bg_color: "030314",
|
||||
},
|
||||
};
|
||||
|
||||
export default themes;
|
||||
|
||||
Reference in New Issue
Block a user