Skip to content

Commit d3e6800

Browse files
committed
Fixing publish/split workflow
1 parent 2b50b47 commit d3e6800

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

.github/workflows/split.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,21 @@ jobs:
5151

5252
# Verify release notes exist for this package
5353
- name: Verify release notes
54+
id: check_notes
5455
run: |
55-
TAG=${{ github.ref_name }} # v0.13.2
56-
NOTES={{ matrix.local }}/release_notes/${TAG}.md
57-
if [[ -f "$NOTES" ]]; then
58-
echo "release notes found: $NOTES"
56+
TAG_NAME=${{ github.ref_name }}
57+
NOTES_PATH="${{ matrix.package.local }}/release_notes/${TAG_NAME}.md"
58+
59+
if [ -f "$NOTES_PATH" ]; then
60+
echo "NOTES_EXIST=true" >> $GITHUB_ENV
61+
echo "Notes found at $NOTES_PATH"
5962
else
60-
echo "no notes – creating stub → $NOTES"
61-
mkdir -p "$(dirname "$NOTES")"
62-
printf '# %s\n\nSplit release of %s.\n' "$TAG" "${{ matrix.name }}" > "$NOTES"
63+
echo "NOTES_EXIST=false" >> $GITHUB_ENV
64+
echo "Warning: No release notes found at $NOTES_PATH"
65+
# Create a minimal release note if none exists
66+
mkdir -p "${{ matrix.package.local }}/release_notes"
67+
echo "# ${TAG_NAME}\n\nThis release is part of the main monorepo release ${TAG_NAME}." > "$NOTES_PATH"
68+
echo "Created minimal release notes"
6369
fi
6470
6571
# ► push branch + tag
@@ -75,12 +81,12 @@ jobs:
7581
user_email: 'ci@cognesy.com'
7682

7783
# ► create GitHub Release with notes
78-
- name: Publish GitHub release
79-
uses: softprops/action-gh-release@v2
84+
- uses: softprops/action-gh-release@v2
8085
if: github.ref_type == 'tag'
8186
env:
82-
GITHUB_TOKEN: ${{ secrets.SPLIT_TOKEN }} # PAT once for all API calls
87+
GITHUB_TOKEN: ${{ secrets.SPLIT_TOKEN }}
8388
with:
8489
repository: ${{ matrix.package.repo }} # target repo
8590
tag_name: ${{ github.ref_name }} # v1.2.3
8691
body_path: ${{ matrix.package.local }}/release_notes/${{ github.ref_name }}.md
92+
# token: ${{ secrets.SPLIT_TOKEN }} # PAT here

0 commit comments

Comments
 (0)