diff --git a/.github/workflows/changeset-version-management.yml b/.github/workflows/changeset-version-management.yml index c7728db..3b76d72 100644 --- a/.github/workflows/changeset-version-management.yml +++ b/.github/workflows/changeset-version-management.yml @@ -65,16 +65,23 @@ jobs: # Default skip state skip="false" # Changeset artifacts - changesetArtifactsPath=".changeset" + changesetArtifactsRegex="\.changeset/.*\.md$" # Commit hash that triggered workflow commitHash="${{ github.sha }}" + + pendingChangesetList=$(find .changeset -type f -name "*.md" ! -name "README.md") + + if [[ -n "$pendingChangesetList" ]]; then + echo "⚠️ There are pending changeset files:" + echo "$pendingChangesetList" + fi # If no changes found, skip - if ! git diff-tree --no-commit-id --name-only "$commitHash" | grep -q "$changesetArtifactsPath"; then + if echo "$pendingChangesetList" | grep -qE "$changesetArtifactsRegex"; then + echo "✅ Changeset found!" + else echo "⚠️ Warning: The .changeset directory doesn't have new changesets, should skip!" skip="true" - else - echo "✅ Changset found!" fi echo "skip=$skip" >> "$GITHUB_OUTPUT"