Skip to content

Conversation

zoxilsi
Copy link
Contributor

@zoxilsi zoxilsi commented Jul 27, 2025

🎯 Purpose

This PR adds automated commit message validation and DCO (Developer Certificate of Origin) enforcement to ensure code quality and legal compliance for all contributions.

✨ Changes

  • Commitlint Workflow (.github/workflows/commitlint.yml)

    • Enforces Conventional Commits standard using @commitlint/config-conventional
    • Validates all commits in pull requests
    • Fails if commit messages don't follow proper format (e.g., feat:, fix:, docs:)
  • DCO Check Workflow (.github/workflows/dco.yml)

    • Uses CNCF DCO GitHub Action to verify signed commits
    • Ensures every commit has Signed-off-by: line
    • Prevents unsigned commits from being merged
  • Commitlint Configuration (commitlint.config.js)

    • Configures allowed commit types and formatting rules
    • Sets maximum header length and case requirements

🔧 How It Works

Both workflows trigger automatically on pull requests to master and main branches. They will:

  • ✅ Pass when commits follow standards and are properly signed
  • ❌ Fail when commits violate formatting rules or lack DCO sign-off

📋 Next Steps

After merging, enable these as required status checks in branch protection settings to enforce compliance.

🧪 Testing

These workflows can be tested by creating PRs with both valid and invalid commit messages/signatures.

closes #13

@zoxilsi
Copy link
Contributor Author

zoxilsi commented Jul 27, 2025

@thedevyashsaini @sapatevaibhav . Can you check and review the PR

Comment on lines 4 to 5
pull_request:
branches: [ master, main ]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a types: filter to the pull_request trigger to avoid unnecessary runs

npm install --save-dev @commitlint/config-conventional @commitlint/cli

- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

block is irrelevant as this workflow is only triggered on pull_request


- name: Install dependencies
run: |
npm install --save-dev @commitlint/config-conventional @commitlint/cli
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Install dependencies should use --no-save instead of --save-dev

Comment on lines 1 to 26
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test'
]
],
'subject-case': [2, 'never', ['start-case', 'pascal-case', 'upper-case']],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'header-max-length': [2, 'always', 72]
}
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add comments for team clarity

@zoxilsi
Copy link
Contributor Author

zoxilsi commented Jul 27, 2025

@thedevyashsaini Made changes as per your review. Do check it out

@thedevyashsaini
Copy link
Collaborator

@thedevyashsaini Made changes as per your review. Do check it out

is .github/pull_request_template.md relevant here?

@zoxilsi
Copy link
Contributor Author

zoxilsi commented Jul 27, 2025

NOT directly relevant for the specific review feedback

IS relevant for overall project improvement:

  • The PR template prevents future issues by ensuring contributors follow DCO requirements
  • It includes a DCO compliance checklist that enforces the standards you just implemented
  • It standardizes the contribution process

@thedevyashsaini

@zoxilsi
Copy link
Contributor Author

zoxilsi commented Jul 28, 2025

@thedevyashsaini can you review the pr

@zoxilsi
Copy link
Contributor Author

zoxilsi commented Jul 30, 2025

@sapatevaibhav Review the pr and give me update

@thedevyashsaini
Copy link
Collaborator

NOT directly relevant for the specific review feedback

IS relevant for overall project improvement:

  • The PR template prevents future issues by ensuring contributors follow DCO requirements
  • It includes a DCO compliance checklist that enforces the standards you just implemented
  • It standardizes the contribution process

@thedevyashsaini

Another PR is opened for the PR #31 template specifically, so remove that part

@zoxilsi
Copy link
Contributor Author

zoxilsi commented Jul 31, 2025

i commited this 3 days ago .
and why you guys are asking me to remove
even though it still relevent
Plz kindly accept it

@sapatevaibhav
Copy link
Member

and why you guys are asking me to remove

^-^

@zoxilsi
Copy link
Contributor Author

zoxilsi commented Aug 1, 2025

and why you guys are asking me to remove

^-^

@sapatevaibhav what is the issue still its not merged and close the pr or the issue
If there something kindly update to me

@sapatevaibhav
Copy link
Member

@thedevyashsaini Except PR template is everything ok?

@sapatevaibhav
Copy link
Member

what is the issue still its not merged and close the pr or the issue

Yes just looking for Mentors confirmation.

@thedevyashsaini
Copy link
Collaborator

i commited this 3 days ago . and why you guys are asking me to remove even though it still relevent Plz kindly accept it

ur being asked to remove the file cuz u can't just write anything in the description and then change random things - someone else is also working on the PR template thing... if u feel like merging multiple issues, u gotta mention that first so that other people don't waster their time on it.

Just remove that file and the PR is good to go....

@thedevyashsaini
Copy link
Collaborator

@thedevyashsaini Except PR template is everything ok?

yea

@sapatevaibhav sapatevaibhav added good first issue Good for newcomers GSSoC'25 GirlScript Summer of Code 2025 level1 labels Aug 11, 2025
@sapatevaibhav sapatevaibhav merged commit 63c96ba into VaibhavCodeClub:master Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers GSSoC'25 GirlScript Summer of Code 2025 level1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Commitlint & DCO GitHub Actions Workflows
3 participants