Skip to content

Commit e618b13

Browse files
authored
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.
1 parent fa814da commit e618b13

1 file changed

Lines changed: 32 additions & 1 deletion

File tree

examples/workflows/AWESOME.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,38 @@ Workflows that help maintain code quality, perform analysis, or enforce standard
3131

3232
Workflows that help manage GitHub issues, projects, or team collaboration.
3333

34-
*No workflows yet. Be the first to contribute!*
34+
### 1. Workflow to Enforce Contribution Guidelines in Pull Requests
35+
36+
**Repository:** [jasmeetsb/gemini-github-actions](https://github.com/jasmeetsb/gemini-github-actions)
37+
38+
**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)
3566

3667
### 📝 Documentation
3768

0 commit comments

Comments
 (0)