Skip to content

Commit 4d2ea8c

Browse files
committed
docs: improving readme and contribution docs
Signed-off-by: Steven Wade <[email protected]>
1 parent 568793e commit 4d2ea8c

File tree

2 files changed

+39
-29
lines changed

2 files changed

+39
-29
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,17 @@ In general, we will merge a PR once one maintainer has endorsed it.
3939
For substantial changes, more people may become involved, and you might
4040
get asked to resubmit the PR or divide the changes into more than one PR.
4141

42-
### Commit Message and Pull Request Requirements:
42+
## Pre-commit hooks
43+
44+
Before working with the repository it is **mandatory** to execute the following command:
45+
46+
```
47+
make initialise
48+
```
49+
50+
The above command will install the `pre-commit` package and setup pre-commit checks for this repository including [conventional-pre-commit](https://github.com/compilerla/conventional-pre-commit) to make sure your commits match the conventional commit convention.
51+
52+
## Commit Message and Pull Request Requirements:
4353

4454
This repository enforces the `Conventional Commits` specification for both commit messages and pull request titles.
4555

README.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,37 @@
1-
# GitHub Action for kustomize-diff
1+
# Kustomize Diff GitHub Action
22

3-
This [action](https://help.github.com/en/actions) can be used in any repository that uses [kustomize](https://kustomize.io/).
3+
This GitHub Action builds and compares Kustomize configurations between the base and head of a Pull Request, posting the differences as a PR comment. This helps reviewers easily identify configuration changes in Kubernetes manifests.
44

5-
# Summary
5+
## Features
6+
7+
- Automatically builds Kustomize configurations from both PR branches
8+
- Generates a diff between base and head configurations
9+
- Configurable root directory and search depth for Kustomize files
10+
- Commits must meet [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
11+
- Automated with GitHub Actions ([commit-lint](https://github.com/conventional-changelog/commitlint/#what-is-commitlint))
12+
- Pull Request titles must meet [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
13+
- Automated with GitHub Actions ([pr-lint](https://github.com/amannn/action-semantic-pull-request))
14+
- Commits must be signed with [Developer Certificate of Origin (DCO)](https://developercertificate.org/)
15+
- Automated with GitHub App ([DCO](https://github.com/apps/dco))
616

7-
The steps the action takes are as follows:
17+
## Inputs
818

9-
- Store the output of `kustomize build` (for each environment) on the current branch in a temporary location.
10-
- Store the output of `kustomize build` (for each environment) on the master branch in a temporary location.
11-
- Based on the two outputs above it performs a git diff and stores the output in a variable called `escaped_output`.
19+
| Name | Description | Required | Default |
20+
|------|-------------|----------|---------|
21+
| `base_ref` | Reference (branch/SHA) for PR base | Yes | `${{ github.base_ref }}` |
22+
| `head_ref` | Reference (branch/SHA) for PR head | Yes | `${{ github.head_ref }}` |
23+
| `pr_num` | Pull Request number/ID | Yes | `${{ github.event.number }}` |
24+
| `token` | GitHub token for authentication | Yes | `${{ github.token }}` |
25+
| `root_dir` | Root directory containing kustomize files | No | `./kustomize` |
26+
| `max_depth` | Maximum depth to search for kustomization files | No | `2` |
1227

13-
This action can be combined with [unsplash/comment-on-pr](https://github.com/unsplash/comment-on-pr) to comment the output to the PR.
28+
## Outputs
1429

15-
# Example configuration
30+
| Name | Description |
31+
|------|-------------|
32+
| `diff` | Generated diff between kustomize built head and base |
33+
34+
## Usage
1635

1736
The below example will run `kustomize-diff` against your branch and commit the changes due to be applied back to your Pull Request.
1837

@@ -62,25 +81,6 @@ jobs:
6281

6382
An example of the commented output can be found [here](https://github.com/swade1987/flux2-kustomize-template/pull/15#issuecomment-2600995488).
6483

65-
## Features
66-
67-
- Commits must meet [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
68-
- Automated with GitHub Actions ([commit-lint](https://github.com/conventional-changelog/commitlint/#what-is-commitlint))
69-
- Pull Request titles must meet [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
70-
- Automated with GitHub Actions ([pr-lint](https://github.com/amannn/action-semantic-pull-request))
71-
- Commits must be signed with [Developer Certificate of Origin (DCO)](https://developercertificate.org/)
72-
- Automated with GitHub App ([DCO](https://github.com/apps/dco))
73-
74-
## Getting started
75-
76-
Before working with the repository it is **mandatory** to execute the following command:
77-
78-
```
79-
make initialise
80-
```
81-
82-
The above command will install the `pre-commit` package and setup pre-commit checks for this repository including [conventional-pre-commit](https://github.com/compilerla/conventional-pre-commit) to make sure your commits match the conventional commit convention.
83-
8484
## Contributing to the repository
8585

8686
To contribute, please read the [contribution guidelines](CONTRIBUTING.md). You may also [report an issue](https://github.com/swade1987/kubernetes-toolkit/issues/new/choose).

0 commit comments

Comments
 (0)