Skip to content

Commit

Permalink
Create auto-summarize-commits.yml
Browse files Browse the repository at this point in the history
Creating auto summarise of changes.
  • Loading branch information
mattloose authored Jan 1, 2025
1 parent cb19c42 commit 96c9509
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 96c9509

Please sign in to comment.