Skip to content

Commit c2f8935

Browse files
authored
Merge pull request #9 from swade1987/improve-readme
docs: improving readme and contribution docs
2 parents 568793e + 266c19a commit c2f8935

File tree

2 files changed

+47
-29
lines changed

2 files changed

+47
-29
lines changed

Diff for: CONTRIBUTING.md

+11-1
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

Diff for: README.md

+36-28
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,45 @@
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+
## Why Use This Action?
6+
Managing Kubernetes configurations across multiple environments and PRs can be challenging. This action automatically generates and posts clear diffs of your Kustomize changes directly in your PR comments. This helps:
67

7-
The steps the action takes are as follows:
8+
🔍 **Catch Configuration Mistakes** - Easily spot unintended changes before they hit production
9+
⏱️ **Speed Up Reviews** - Reviewers can instantly see what's changing without checking out the code
10+
🔄 **Validate Changes** - Confirm your Kustomize overlays are working as expected
11+
📝 **Document Changes** - Automatically track and document configuration changes in PR history
812

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`.
13+
## Features
14+
15+
- Automatically builds Kustomize configurations from both PR branches
16+
- Generates a diff between base and head configurations
17+
- Configurable root directory and search depth for Kustomize files
18+
- Commits must meet [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
19+
- Automated with GitHub Actions ([commit-lint](https://github.com/conventional-changelog/commitlint/#what-is-commitlint))
20+
- Pull Request titles must meet [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
21+
- Automated with GitHub Actions ([pr-lint](https://github.com/amannn/action-semantic-pull-request))
22+
- Commits must be signed with [Developer Certificate of Origin (DCO)](https://developercertificate.org/)
23+
- Automated with GitHub App ([DCO](https://github.com/apps/dco))
1224

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.
25+
## Inputs
1426

15-
# Example configuration
27+
| Name | Description | Required | Default |
28+
|------|-------------|----------|---------|
29+
| `base_ref` | Reference (branch/SHA) for PR base | Yes | `${{ github.base_ref }}` |
30+
| `head_ref` | Reference (branch/SHA) for PR head | Yes | `${{ github.head_ref }}` |
31+
| `pr_num` | Pull Request number/ID | Yes | `${{ github.event.number }}` |
32+
| `token` | GitHub token for authentication | Yes | `${{ github.token }}` |
33+
| `root_dir` | Root directory containing kustomize files | No | `./kustomize` |
34+
| `max_depth` | Maximum depth to search for kustomization files | No | `2` |
35+
36+
## Outputs
37+
38+
| Name | Description |
39+
|------|-------------|
40+
| `diff` | Generated diff between kustomize built head and base |
41+
42+
## Usage
1643

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

@@ -62,25 +89,6 @@ jobs:
6289

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

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-
8492
## Contributing to the repository
8593

8694
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)