mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 15:26:16 -04:00
Meta: do not create release when there are no public changes
This commit is contained in:
parent
60b651de7e
commit
ca6a6009ac
9
.github/scripts/changelog.sh
vendored
9
.github/scripts/changelog.sh
vendored
|
|
@ -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
|
||||
|
|
|
|||
3
.github/workflows/release.yaml
vendored
3
.github/workflows/release.yaml
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue