Skip to content

Commit

Permalink
Merge pull request #90 from LooseLab/mattloose-patch-3
Browse files Browse the repository at this point in the history
Create auto-summarize-commits.yml
  • Loading branch information
mattloose authored Jan 1, 2025
2 parents cb19c42 + 96c9509 commit c76877c
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/auto-summarize-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Auto-Summarize Commits

on:
pull_request:
types: [opened, synchronize]

jobs:
summarize_commits:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Summarize Commits
id: summarize
run: |
PR_BRANCH=$(echo "${{ github.head_ref }}")
BASE_BRANCH=$(echo "${{ github.base_ref }}")
COMMITS=$(git log origin/$BASE_BRANCH..origin/$PR_BRANCH --pretty=format:"- %s" --no-merges)
if [[ -z "$COMMITS" ]]; then
echo "No commits found between $BASE_BRANCH and $PR_BRANCH."
exit 1
fi
echo "::set-output name=commits::$COMMITS"
- name: Post Summary to Pull Request
uses: thollander/actions-comment-pull-request@v1
with:
message: |
### Summary of Commits
${{ steps.summarize.outputs.commits }}

0 comments on commit c76877c

Please sign in to comment.