ci: use sparse checkout for release notes in release workflow
Only fetch RELEASE_NOTES.md instead of full repo checkout, and simplify the file detection to a direct path check.
This commit is contained in:
@@ -12,8 +12,11 @@ jobs:
|
||||
outputs:
|
||||
release_id: ${{ steps.create.outputs.release_id }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
- name: Fetch RELEASE_NOTES.md only
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
sparse-checkout: RELEASE_NOTES.md
|
||||
sparse-checkout-cone-mode: false
|
||||
|
||||
- name: Create Gitea release
|
||||
id: create
|
||||
@@ -33,11 +36,9 @@ jobs:
|
||||
REPO=$(echo "${{ gitea.repository }}" | tr '[:upper:]' '[:lower:]')
|
||||
DOCKER_IMAGE="${SERVER_HOST}/${REPO}"
|
||||
|
||||
# Scan for RELEASE_NOTES.md (check repo root first, then recursively)
|
||||
NOTES_FILE=$(find . -maxdepth 3 -name "RELEASE_NOTES.md" -type f | head -1)
|
||||
if [ -n "$NOTES_FILE" ]; then
|
||||
export RELEASE_NOTES=$(cat "$NOTES_FILE")
|
||||
echo "Found release notes: $NOTES_FILE"
|
||||
if [ -f RELEASE_NOTES.md ]; then
|
||||
export RELEASE_NOTES=$(cat RELEASE_NOTES.md)
|
||||
echo "Found RELEASE_NOTES.md"
|
||||
else
|
||||
export RELEASE_NOTES=""
|
||||
echo "No RELEASE_NOTES.md found"
|
||||
|
||||
Reference in New Issue
Block a user