-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed as not planned
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Feature summary
Problem to fix when commits are sqashed.
Feature description
this is a common problem - when commits are squashed during PR merges - credit for original contributors gets lot.
git co-author is for that
https://www.dormant.ninja/git-co-author-script/
draft co author - github CI
name: Add Co-Authors
on:
pull_request:
types: [closed]
jobs:
add-coauthors:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Add co-authors
run: |
# Extract contributors and append as co-authors (refer script)
# Define the base branch (e.g., main or master)
BASE_BRANCH=main
# Find the merge base (divergence point) between the current branch and the base branch
MERGE_BASE=$(git merge-base HEAD $BASE_BRANCH)
# Extract contributors from the commits starting at the merge base up to HEAD
CONTRIBUTORS=$(git log $MERGE_BASE..HEAD --format='%aN <%aE>' | sort | uniq)
# Output or append contributors as Co-authored-by lines
for CONTRIBUTOR in $CONTRIBUTORS; do
echo "Co-authored-by: $CONTRIBUTOR"
doneMotivation
No response
Alternatives considered
No response
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers