feat: Add total commits to [GitHubCommitActivity] (#9196)

* feat: Add total commits to GithubCommitActivity

As part of a new feature proposed at issue #6070 added the requested feature.
I also used the conversation at pull request #6081 as a basis for those changes.

This change adds a new interval to the github/commit-activity shield 'total' (t for short).
The interval shows the total commits of the repo since its creation.

* Fix format with prettier

* Label for 'total' interval is now commits

Label change for the 'total' interval from 'commit activity' to 'commits'

---------

Co-authored-by: jNullj <jNullj@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
jNullj
2023-05-29 22:46:41 +03:00
committed by GitHub
parent 759514337c
commit 8a11db8265
2 changed files with 18 additions and 5 deletions

View File

@@ -2,6 +2,7 @@ import Joi from 'joi'
import {
isMetricOverTimePeriod,
isZeroOverTimePeriod,
isMetric,
} from '../test-validators.js'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
@@ -11,6 +12,11 @@ const isCommitActivity = Joi.alternatives().try(
isZeroOverTimePeriod
)
t.create('commit acticity (total)').get('/t/badges/shields.json').expectBadge({
label: 'commits',
message: isMetric,
})
t.create('commit activity (1 year)').get('/y/eslint/eslint.json').expectBadge({
label: 'commit activity',
message: isMetricOverTimePeriod,