You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Github-workflow to automate validation of new PRs based on Contribution Guidelines of the repository (#162)
Github-Workflow to automate validation of pull requests against your
repository's "CONTRIBUTING.md" guidelines using Google Gemini.
Key Features:
- Smart validation - understands complex guidelines beyond simple
pattern matching
- Actionable feedback - provides specific checklist items with links to
guidelines
- Manual re-validation via "/validate-contribution" comments in PRs
- Configurable enforcement - can warn or fail based on violations
Perfect for maintaining contribution quality while being helpful to new
contributors.
**Description:** Automates validation of pull requests against your repository's CONTRIBUTING.md using the Google Gemini CLI. The workflow posts a single upserted PR comment indicating PASS/FAIL with a concise checklist of actionable items, and can optionally fail the job to enforce compliance.
39
+
40
+
**Key Features:**
41
+
42
+
- Reads and evaluates PR title, body, and diff against CONTRIBUTING.md
43
+
- Posts a single PR comment with a visible PASS/FAIL marker in Comment Title and details of compliance status in the comment body
44
+
- Optional enforcement: fail the workflow when violations are detected
45
+
46
+
**Setup Requirements:**
47
+
48
+
- Copy [.github/workflows/pr-contribution-guidelines-enforcement.yml](https://github.com/jasmeetsb/gemini-github-actions/blob/main/.github/workflows/pr-contribution-guidelines-enforcement.yml) to your .github/workflows/ folder.
49
+
- File: `CONTRIBUTING.md` at the repository root
50
+
- (Optional) Repository variable `FAIL_ON_GUIDELINE_VIOLATIONS=true` to fail the workflow on violations
51
+
52
+
**Example Usage:**
53
+
54
+
- Define contribution guidelines in CONTRIBUTING.md file
55
+
- Open a new PR or update an existing PR, which would then trigger the workflow
56
+
- Workflow will validate the PR against the contribution guidelines and add a comment in the PR with PASS/FAIL status and details of guideline compliance and non-compliance
57
+
58
+
**OR**
59
+
60
+
- Add following comment in an existing PR **"/validate-contribution"** to trigger the workflow
61
+
62
+
**Workflow File:**
63
+
64
+
- Example location in this repo: [.github/workflows/pr-contribution-guidelines-enforcement.yml](https://github.com/jasmeetsb/gemini-github-actions/blob/main/.github/workflows/pr-contribution-guidelines-enforcement.yml)
65
+
- Typical usage in a consumer repo: `.github/workflows/pr-contribution-guidelines-enforcement.yml` (copy the file and adjust settings/secrets as needed)
0 commit comments