-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f715892
commit 0052f89
Showing
1 changed file
with
41 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
@@ -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 | ||
|
@@ -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: | ||
|