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:
|
outputs:
|
||||||
release_id: ${{ steps.create.outputs.release_id }}
|
release_id: ${{ steps.create.outputs.release_id }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Fetch RELEASE_NOTES.md only
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
sparse-checkout: RELEASE_NOTES.md
|
||||||
|
sparse-checkout-cone-mode: false
|
||||||
|
|
||||||
- name: Create Gitea release
|
- name: Create Gitea release
|
||||||
id: create
|
id: create
|
||||||
@@ -33,11 +36,9 @@ jobs:
|
|||||||
REPO=$(echo "${{ gitea.repository }}" | tr '[:upper:]' '[:lower:]')
|
REPO=$(echo "${{ gitea.repository }}" | tr '[:upper:]' '[:lower:]')
|
||||||
DOCKER_IMAGE="${SERVER_HOST}/${REPO}"
|
DOCKER_IMAGE="${SERVER_HOST}/${REPO}"
|
||||||
|
|
||||||
# Scan for RELEASE_NOTES.md (check repo root first, then recursively)
|
if [ -f RELEASE_NOTES.md ]; then
|
||||||
NOTES_FILE=$(find . -maxdepth 3 -name "RELEASE_NOTES.md" -type f | head -1)
|
export RELEASE_NOTES=$(cat RELEASE_NOTES.md)
|
||||||
if [ -n "$NOTES_FILE" ]; then
|
echo "Found RELEASE_NOTES.md"
|
||||||
export RELEASE_NOTES=$(cat "$NOTES_FILE")
|
|
||||||
echo "Found release notes: $NOTES_FILE"
|
|
||||||
else
|
else
|
||||||
export RELEASE_NOTES=""
|
export RELEASE_NOTES=""
|
||||||
echo "No RELEASE_NOTES.md found"
|
echo "No RELEASE_NOTES.md found"
|
||||||
|
|||||||
Reference in New Issue
Block a user