diff --git a/.github/workflows/pr-one-commit-per-user-check.yml b/.github/workflows/pr-one-commit-per-user-check.yml deleted file mode 100644 index 3025a9d75f9..00000000000 --- a/.github/workflows/pr-one-commit-per-user-check.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Fineract PR One Commit Per User Check - - -on: - pull_request: - types: [opened, reopened, synchronize] - - -permissions: - pull-requests: write - - -jobs: - verify-commits: - name: Validate One Commit Per User - runs-on: ubuntu-latest - timeout-minutes: 1 - steps: - - name: Verify Commit Policy - id: check - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - - commits=$(gh api "repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/commits") || { echo "::error::GitHub API request failed"; exit 1; } - - if echo "$commits" | jq -e '.[] | select(.author == null)' > /dev/null; then - echo "null_authors=true" >> $GITHUB_OUTPUT - echo "::error::Some commits have a git email that is not linked to a GitHub account. Please ensure your git email matches one of your GitHub Account emails.\n\nPlease also squash your commits to prevent this message again." - exit 1 - fi - - user_ids=$(echo "$commits" | jq -r '.[] | select(.author.type != "Bot") | .author.id') - if echo "$user_ids" | sort | uniq -d | grep -q .; then - echo "multiple_commits=true" >> $GITHUB_OUTPUT - echo "::error::Multiple commits from the same author have been detected." - exit 1 - fi - - echo "Success: Each author has exactly one commit." - - - name: Comment on PR - if: failure() - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - - if [ "${{ steps.check.outputs.null_authors }}" == "true" ]; then - gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body \ - $'**One Commit Per User Check Failed**\n\nSome committers have a git email that does not match their GitHub account. Please ensure your git email matches one of your GitHub Account emails. Please also squash your commits to prevent this message again.' - fi - - - if [ "${{ steps.check.outputs.multiple_commits }}" == "true" ]; then - gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body \ - $'**One Commit Per User Check Failed**\n\nEach user may only have one commit per PR. Please squash your commits.' - fi diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fe5e8d41abc..17e4951e7c3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -279,7 +279,7 @@ We have an automated bot which marks pull requests as "stale" after a while, and This project's committers typically prefer to bring your pull requests in through _Rebase and Merge_ instead of _Create a Merge Commit_. (If you are unfamiliar with GitHub's UI regarding this, note the somewhat hidden little triangle drop-down at the bottom of the PR, visible only to committers, not contributors.) This avoids the "merge commits" which we consider to be somewhat "polluting" the project's commit log history view. We understand this doesn't give an easy automatic reference to the original PR (which GitHub automatically adds to the merge commit message it generates), but we consider this an only very minor inconvenience; it's typically relatively easy to find the original PR even just from the commit message, and JIRA. -We expect most proposed PRs to typically consist of a single commit. Committers may use _Squash and merge_ to combine your commits at merge time, and if they do so, will rewrite your commit message as they see fit. +Contributors may include multiple commits in a PR. There is no longer a one-commit-per-user expectation. Authors are encouraged to organize commits in a way that best communicates the development and review history of the change. Keeping commits logical and reviewable is preferred, but preserving intermediate work, follow-up fixes, and signed commits is fully acceptable. Neither of these two are hard absolute rules, but mere conventions. Multiple commits in single PRs make sense in certain cases (e.g. branch backports).