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

Update README.md #26

Merged
merged 2 commits into from
Sep 13, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update README.md
  • Loading branch information
gcattan authored Sep 13, 2022
commit 1a88c400284ddc9dcbeaded75bf46564142ccfed
58 changes: 56 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<img type="image/svg" src="https://byob.yarr.is/gcattan/git-quality-check/score"/>

# git-quality-check (WIP)
# git-quality-check
Simple tool to check quality of git commits, and build indicators on it.
Four estimation are performed:
- the percent of commits containg a list of prohibited words;
Expand All @@ -13,7 +13,35 @@ When there is more than 10 branches, the program randomly select 10 branches amo
The overall score returned as an output is a combination of these score.
The closer to 100%, the higher the quality.

An example is available [here](.github/workflows/test-action.yml).
## Examples

Place the folowing example in your `.github/workflows` repository (in a file called `test-action.yml`) for example:

```
name: Test Action

on: [push]

jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Git Quality Check
id: git-quality-check
uses: gcattan/git-quality-check@v0.1
with:
badWords: WIP, todo
mainBranches: origin/master, origin/develop, origin/main
- name: Check outputs
run: |
test "${{ steps.git-quality-check.outputs.score }}" != ""
```

The example above will checkout and run `git-quality-check` on your repo.

## Description of inputs

Expand All @@ -27,3 +55,29 @@ An example is available [here](.github/workflows/test-action.yml).
|Field|Descrition|
|-|-|
|score|The overall score for your repository. It takes into account the percent of "bad" commits, commits related to testing, old branches and coupling.|

## Adding a badge to your README

You may find convenient to add a badge on your readme to display the score obtained with git quality check.
This is a two steps process:

1) Add https://github.com/RubbaBoy/BYOB action at the end of your `test-action.yml` file as follows:

```
- name: Create badge
uses: RubbaBoy/BYOB@v1.3.0
with:
NAME: score
LABEL: 'Git Quality Score'
STATUS: ${{ steps.git-quality-check.outputs.score }}
COLOR: 00EEFF
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

You can find the complete example of `test-action.yml` [here](.github/workflows/test-action.yml).

2) Add this line to your `README`:

```<img type="image/svg" src="https://byob.yarr.is/<your github account>/<your project>/score"/>```

Do not forget to replace <you github account> and <your project> in the above!!