Skip to content

Update Graylog Version - manaul #3

Update Graylog Version - manaul

Update Graylog Version - manaul #3

name: "Update Graylog Version - manaul"
on:
workflow_dispatch:
permissions:
contents: write
jobs:
Update-Docker-Compose-File:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v4"
- name: "Check Current Version and update if needed"
shell: "bash"
run: |
GRAYLOG_LATEST=$(curl -L --fail "https://hub.docker.com/v2/repositories/graylog/graylog/tags/?page_size=1000" | jq '.results | .[] | .name' -r | sed 's/latest//' | sort --version-sort | awk '!/beta/' | awk '!/alpha/' | awk '!/-rc/' | tail -n 1)
GRAYLOG_CURRENT=$(sed -n "s/GRAYLOG_VERSION=//p" autogl/.env)
if [[ "$GRAYLOG_LATEST" != "$GRAYLOG_CURRENT" ]]; then
echo "update plz"
sed -i "s/^GRAYLOG_VERSION=$GRAYLOG_CURRENT/GRAYLOG_VERSION=$GRAYLOG_LATEST/g" autogl/.env
else
echo "updated already"
exit 0
fi
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Git Actions Updated Docker Compose"
git push