Meta: do not create release when there are no public changes (#401)
Some checks failed
ci / build (ubuntu-22.04) (push) Failing after 1s
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-20.04) (push) Has been cancelled

This commit is contained in:
Tim 2024-11-04 10:17:59 +01:00 committed by GitHub
parent 60b651de7e
commit 2d5f8f48f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View file

@ -1,5 +1,7 @@
#!/bin/bash
release_has_public_changes=false
url=$(git remote get-url origin | sed -r 's/(.*)\.git/\1/')
previous_tag=$(git describe --tags --abbrev=0 HEAD~)
@ -23,5 +25,12 @@ do
# Escape markdown formatting symbols _ * `
echo " $line" | sed 's/_/\\_/g' | sed 's/`/\\`/g' | sed 's/\*/\\\*/g'
done
release_has_public_changes=true
fi
done
if ! $release_has_public_changes
then
echo "No public changes since $previous_tag." >&2
exit 1
fi

View file

@ -20,10 +20,13 @@ jobs:
run: tar -czf forgit-${{github.ref_name}}.tar.gz --exclude LICENSE --exclude README.md *
- name: Generate Changelog
id: changelog
run: .github/scripts/changelog.sh > CHANGELOG.md
continue-on-error: true
- name: Release
uses: softprops/action-gh-release@v2
if: steps.changelog.outcome == 'success'
with:
body_path: CHANGELOG.md
files: forgit-${{github.ref_name}}.tar.gz