Skip to content

Commit d043d74

Browse files
committed
feat(docs): add a contribution guide
1 parent d5f97ef commit d043d74

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

CONTRIBUTING.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Contributing Guide
2+
3+
Thank you for your interest in contributing! This repository hosts versioned PHP Docker images with optional NVM and Node.js support.
4+
5+
## 📋 Contribution Checklist
6+
7+
Before opening a Pull Request, please make sure that:
8+
9+
- You are modifying or adding files in the correct version folder (e.g. `8.3/Dockerfile`)
10+
- Your PR **title follows the [Conventional Commits](https://www.conventionalcommits.org/) format** and includes a valid **scope**
11+
- ✅ Correct examples:
12+
- `feat(8.4): add support for PHP 8.4`
13+
- `fix(8.3): correct NVM install path`
14+
- `chore(8.3): update nvm version`
15+
- ❌ Invalid examples (missing scope or wrong format):
16+
- `feat: add PHP 8.4` ← missing scope
17+
- `fix php 8.3 image` ← not a conventional commit format
18+
19+
> The `scope` must describe the context of the change, such as the PHP version (`8.0`, `8.3`, etc.) or a general target like `docker` or `ci`.
20+
21+
- Your Dockerfile change builds successfully
22+
- The GitHub workflow will attempt to build the image automatically
23+
- You can also test locally with:
24+
```sh
25+
docker build -t php-custom:8.3 ./8.3
26+
```
27+
28+
## ✅ Best Practices
29+
30+
- **Avoid modifying multiple PHP versions in a single PR** unless necessary
31+
- Keep version-specific differences minimal and well-documented in `README.md` if needed
32+
- If adding a new PHP version (e.g. `8.4`), use the closest previous version (e.g. `8.3`) as a starting point
33+
34+
## 🧪 CI Workflow
35+
36+
All PRs trigger a GitHub Actions workflow which will:
37+
38+
- Validate the PR title against Conventional Commits with required scope
39+
- Build the updated Docker image to ensure it compiles successfully
40+
41+
After a successful squash merge a GitHub Actions workflow will publish the new versions to Docker Hub.
42+
43+
You can find the workflow definitions at [.github/workflows](.github/workflows).
44+
45+
## 🛡️ Security
46+
47+
If you're introducing or updating external binaries (e.g. Node.js, NVM), use official sources and verify integrity (e.g. via checksum or GPG).
48+
49+
If you're unsure about anything, feel free to open a draft PR or discussion.

0 commit comments

Comments
 (0)