fetch-asterisk-releases - skip git operations if there is no updates

remotes/origin/andrius/issue16
Andrius Kairiukstis 2 years ago
parent 3735611c62
commit f0f0c60799
No known key found for this signature in database
GPG Key ID: 5FF87DD5A462570A

@ -32,7 +32,7 @@ jobs:
- name: Fetch asterisk releases
shell: bash
run: |
set -ueox pipefail
set -ueo pipefail
URLS=( \
http://downloads.asterisk.org/pub/telephony/asterisk/releases/ \
@ -80,16 +80,20 @@ jobs:
- name: Commit and push updates
shell: bash
run: |
set -ueox pipefail
git config user.email "github-actions@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add ./asterisk-releases.txt
git add ./asterisk-certified-releases.txt
git commit \
--all \
--allow-empty \
--message "[$(date '+%Y-%m-%d %H:%M')] automatic update of asterisk release lists"
git push
set -ueo pipefail
if [ "$(git status -s)" == "" ]; then
git config user.email "github-actions@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add ./asterisk-releases.txt
git add ./asterisk-certified-releases.txt
git commit \
--all \
--allow-empty \
--message "[$(date '+%Y-%m-%d %H:%M')] automatic update of asterisk release lists"
git push
else
echo "Nothing to push, no updates"
fi

Loading…
Cancel
Save