Skip to content

Commit d97f76b

Browse files
authored
doc: updated documentation (#14)
* doc: updated CONTRIBUTING * doc: fixed typo * update
1 parent fa223db commit d97f76b

File tree

4 files changed

+63
-12
lines changed

4 files changed

+63
-12
lines changed

.github/workflows/docker-image.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ name: Docker Image CI
44
on:
55
push:
66
branches: [ main ]
7-
pull_request:
8-
branches: [ main ]
97

108
jobs:
119

CONTRIBUTING.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1-
# Contributing to workflow-metrics
1+
# Contributing to `workflow-metrics`
22

3-
TBA
3+
Thank you for your interest in contributing to `workflow-metrics`! We welcome contributions from everyone, and we appreciate your help in making this action better.
4+
5+
## Getting Started
6+
7+
Before you start contributing, please make sure that you have read the [README.md](./README.md) file and have a basic understanding of the action.
8+
9+
## How to Contribute
10+
11+
There are many ways to contribute to `workflow-metrics`, from writing code to submitting bug reports. Here are some ways that you can contribute:
12+
13+
### Submitting Issues
14+
15+
If you find a bug or have a feature request, please submit an issue on the [GitHub issue tracker](https://github.com/kittychiu/workflow-metrics/issues). Please include as much detail as possible, including steps to reproduce the issue and any relevant error messages.
16+
17+
### Contributing Code
18+
19+
If you would like to contribute code to `workflow-metrics`, please follow these steps:
20+
21+
1. Fork the repository on GitHub.
22+
2. Clone your forked repository to your local machine.
23+
3. Create a new branch for your changes.
24+
4. Make your changes and commit them to your branch.
25+
5. Push your changes to your forked repository on GitHub.
26+
6. Submit a pull request to the main repository.
27+
28+
Please make sure that your code follows the [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide and includes tests for any new functionality.
29+
30+
### Contributing Documentation
31+
32+
If you would like to contribute documentation to `workflow-metrics`, please follow these steps:
33+
34+
1. Fork the repository on GitHub.
35+
2. Clone your forked repository to your local machine.
36+
3. Create a new branch for your changes.
37+
4. Make your changes and commit them to your branch.
38+
5. Push your changes to your forked repository on GitHub.
39+
6. Submit a pull request to the main repository.
40+
41+
Please make sure that your documentation follows the [Markdown syntax](https://www.markdownguide.org/basic-syntax/) and is clear and concise.
42+
43+
## Code of Conduct
44+
45+
Please note that this project is released with a [Contributor Code of Conduct](./CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
46+
47+
## License
48+
49+
`workflow-metrics` is released under the [MIT License](./LICENSE).

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Workflow Metrics Action
22

3+
[![CodeQL](https://github.com/KittyChiu/workflow-metrics/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/KittyChiu/workflow-metrics/actions/workflows/github-code-scanning/codeql) [![Docker Image CI](https://github.com/KittyChiu/workflow-metrics/actions/workflows/docker-image.yml/badge.svg)](https://github.com/KittyChiu/workflow-metrics/actions/workflows/docker-image.yml)
4+
35
This GitHub Action provides a way to evaluate statistics for your GitHub Actions workflows. With this action, you can easily monitor the performance of your workflows and identify areas for improvement.
46

57
Metrics that are evaluated are:
@@ -25,7 +27,7 @@ The following options are available for configuring the action:
2527
| --- | --- | --- | --- |
2628
| `GH_TOKEN` | Yes | N/A | A GitHub token with access to the repository. Minimal scope is `repo` |
2729
| `OWNER_NAME` | Yes | N/A | Name of the repository owner. |
28-
| `REPO_NAME` | No | N/A | Name of the repository. If `REPO_NAME` is not provide, the action will analyse all the workflow runs in the organisation. |
30+
| `REPO_NAME` | No | N/A | Name of the repository. If `REPO_NAME` is not provided, the action will analyse all the workflow runs in the organisation. |
2931
| `START_DATE` | Yes | N/A | Start date for the workflow runs data set. This should be in the format `YYYY-MM-DD`. |
3032
| `END_DATE` | Yes | N/A | End date for the workflow runs data set. This should be in the format `YYYY-MM-DD`. |
3133
| `DELAY_BETWEEN_QUERY` | No | N/A | No. of seconds to wait between queries to the GitHub API. This is to prevent errors from rate limiting when analysing the whole org. |
@@ -37,6 +39,7 @@ After the action has completed, two files will be created in the root of the run
3739
- `runs.json` or `org-runs.json` - a JSON array of all workflow runs in the specified time range for the specified repository or organization.
3840
- `workflow-stats.csv` or `org-workflow-stats.csv` - a CSV file with workflow run statistics for the specified repository or organization.
3941

42+
These are data files that then can be used for further analysis or reporting in visualizer of your choice. For example, you can ingest into datastore and visualize with PowerBI. Below are some examples on generating markdown table and mermaid diagram with the data files
4043

4144
## Example usages
4245

@@ -57,7 +60,7 @@ jobs:
5760
uses: actions/checkout@v3
5861

5962
- name: Call workflow-runs action
60-
uses: KittyChiu/[email protected].5
63+
uses: kittychiu/[email protected].7
6164
env:
6265
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6366
OWNER_NAME: "myOrg"
@@ -118,7 +121,7 @@ jobs:
118121
echo "REPO_NAME=${repo}" >> $GITHUB_ENV
119122
120123
- name: Call workflow-runs action
121-
uses: KittyChiu/[email protected].5
124+
uses: kittychiu/[email protected].7
122125
env:
123126
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124127
REPO_NAME: ${{ env.REPO_NAME }}
@@ -195,7 +198,6 @@ jobs:
195198
runs-on: ubuntu-latest
196199
env:
197200
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
198-
OWNER_NAME: ${{ github.repository_owner }}
199201
200202
steps:
201203
- name: Checkout code
@@ -207,12 +209,14 @@ jobs:
207209
echo "END_DATE=$(date +%Y-%m-%d)" >> "$GITHUB_ENV"
208210
209211
- name: Test docker action
210-
uses: KittyChiu/[email protected].5
212+
uses: kittychiu/[email protected].7
211213
env:
212-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
214+
GH_TOKEN: ${{ env.GH_TOKEN }}
215+
OWNER_NAME: ${{ github.repository_owner }}
213216
START_DATE: ${{ env.START_DATE }}
214217
END_DATE: ${{ env.END_DATE }}
215-
218+
DELAY_BETWEEN_QUERY: 5
219+
216220
- name: Convert org-workflow-stats.csv to stats-table.md markdown table
217221
run: |
218222
echo -e "## Table View\n" > stats-table.md
@@ -246,7 +250,7 @@ Below is an example of the `stats-table.md` file:
246250
|repo_1|Test|3.00|3.00|100.00|1|
247251
|repo_1|Build|20.20|17.00|80.00|5|
248252
|repo_1|Deploy|17.00|17.00|100.00|1|
249-
|repo_2|Governance Validation|2.00|2.00|100.00|1|
253+
|repo_2|Custom Validation|2.00|2.00|100.00|1|
250254
|repo_2|Linter|2.00|2.00|100.00|1|
251255
|repo_3|Superlinter|25.38|23.00|30.00|50|
252256
|repo_3|Long Build|36.17|36.50|53.70|54|

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ description: Generate metrics for historical workflow runs
44
runs:
55
using: 'docker'
66
image: 'docker://ghcr.io/kittychiu/workflow-metrics:v1'
7+
branding:
8+
icon: 'rss'
9+
color: 'orange'

0 commit comments

Comments
 (0)