chore: fix build_release.yml (#867)

This commit is contained in:
jiuqianyuan
2025-04-16 10:35:02 +08:00
committed by GitHub
parent d7db24033d
commit b047f033cb

View File

@@ -21,18 +21,18 @@ jobs:
run: | run: |
prev_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "none") prev_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "none")
echo "Previous tag: $prev_tag"
echo "previous_tag=$prev_tag" >> $GITHUB_ENV
if [ "$prev_tag" == "none" ]; then if [ "$prev_tag" == "none" ]; then
echo "No tags found. Setting changed=true by default." echo "No tags found. Setting changed=true by default."
echo "changed=true" >> $GITHUB_ENV echo "changed=true" >> $GITHUB_ENV
else
echo "Previous tag: $prev_tag"
echo "previous_tag=$prev_tag" >> $GITHUB_ENV
fi fi
- name: Check for changes between previous tag and latest commit in src directory - name: Check for changes between previous tag and latest commit in src directory
id: changes id: changes
run: | run: |
if [ "$prev_tag" != "none" ]; then if [ "${{ env.previous_tag }}" != "none" ]; then
if git diff --exit-code ${{ env.previous_tag }} HEAD -- src; then if git diff --exit-code ${{ env.previous_tag }} HEAD -- src; then
echo "No changes detected in 'src' directory between ${{ env.previous_tag }} and the latest commit." echo "No changes detected in 'src' directory between ${{ env.previous_tag }} and the latest commit."
echo "changed=false" >> $GITHUB_ENV echo "changed=false" >> $GITHUB_ENV