Skip to content

Commit

Permalink
Disable release notes for now
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcorner committed May 21, 2024
1 parent f715892 commit 0052f89
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish React-UI Pre-release to npm registry
name: Publish React-UI Pre-release to npm

on:
push:
Expand All @@ -19,33 +19,33 @@ jobs:
run: git fetch origin main:main
shell: bash

- name: Check for merge commits
id: check
run: |
echo "Checking for merge commits since branching from main..."
# Find the commit where the current branch diverged from main
DIVERGE_POINT=$(git merge-base main HEAD)
# Get the merge commits since that point, excluding certain patterns (Merge branch, Merge pull request)
MERGE_COMMITS=$(git log --merges $DIVERGE_POINT..HEAD --pretty=format:"%h %s" | grep -v -E 'Merge branch .* into .*|Merge pull request .* from .*')
echo "Merge commits:"
echo "$MERGE_COMMITS"
# Write the merge commits to commit_messages.txt in bullet point format
COMMIT_MESSAGES=$(git log --merges $DIVERGE_POINT..HEAD --pretty=format:"* %h %s" | grep -v -E 'Merge branch .* into .*|Merge pull request .* from .*')
echo "$COMMIT_MESSAGES" > commit_messages.txt
# Count the merge commits, excluding empty lines
MERGE_COMMIT_COUNT=$(echo "$MERGE_COMMITS" | grep -v '^$' | wc -l)
if [ "$MERGE_COMMIT_COUNT" -eq "0" ]; then
echo "No new merge commits found. Cancelling workflow."
echo "cancel=true" >> $GITHUB_OUTPUT
else
echo "cancel=false" >> $GITHUB_OUTPUT
echo "merge_commits=$MERGE_COMMITS" >> $GITHUB_OUTPUT
fi
shell: bash

- name: Cancel workflow if no merge commits
uses: andymckay/[email protected]
if: steps.check.outputs.cancel == 'true'
# - name: Check for merge commits
# id: check
# run: |
# echo "Checking for merge commits since branching from main..."
# # Find the commit where the current branch diverged from main
# DIVERGE_POINT=$(git merge-base main HEAD)
# # Get the merge commits since that point, excluding certain patterns (Merge branch, Merge pull request)
# MERGE_COMMITS=$(git log --merges $DIVERGE_POINT..HEAD --pretty=format:"%h %s" | grep -v -E 'Merge branch .* into .*|Merge pull request .* from .*')
# echo "Merge commits:"
# echo "$MERGE_COMMITS"
# # Write the merge commits to commit_messages.txt in bullet point format
# COMMIT_MESSAGES=$(git log --merges $DIVERGE_POINT..HEAD --pretty=format:"* %h %s" | grep -v -E 'Merge branch .* into .*|Merge pull request .* from .*')
# echo "$COMMIT_MESSAGES" > commit_messages.txt
# # Count the merge commits, excluding empty lines
# MERGE_COMMIT_COUNT=$(echo "$MERGE_COMMITS" | grep -v '^$' | wc -l)
# if [ "$MERGE_COMMIT_COUNT" -eq "0" ]; then
# echo "No new merge commits found. Cancelling workflow."
# echo "cancel=true" >> $GITHUB_OUTPUT
# else
# echo "cancel=false" >> $GITHUB_OUTPUT
# echo "merge_commits=$MERGE_COMMITS" >> $GITHUB_OUTPUT
# fi
# shell: bash

# - name: Cancel workflow if no merge commits
# uses: andymckay/[email protected]
# if: steps.check.outputs.cancel == 'true'

- name: Install pnpm
uses: pnpm/action-setup@v3
Expand Down Expand Up @@ -95,19 +95,19 @@ jobs:
git push
git push --tags
- name: Generate Release Notes from Merge Commit Messages
run: |
echo "Generating release notes based on merge commits..."
echo "${{ steps.check.outputs.merge_commits }}" > merge_commits.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: "v${{ env.VERSION }}"
name: "${{ env.VERSION }}"
body_path: commit_messages.txt
draft: false
prerelease: true
# - name: Generate Release Notes from Merge Commit Messages
# run: |
# echo "Generating release notes based on merge commits..."
# echo "${{ steps.check.outputs.merge_commits }}" > merge_commits.txt

# - name: Create GitHub Release
# uses: softprops/action-gh-release@v1
# with:
# tag_name: "v${{ env.VERSION }}"
# name: "${{ env.VERSION }}"
# body_path: commit_messages.txt
# draft: false
# prerelease: true

- name: Post Release Message to Teams
env:
Expand Down

0 comments on commit 0052f89

Please sign in to comment.