Skip to content

Retry and reconnects: #17

Retry and reconnects:

Retry and reconnects: #17

Workflow file for this run

---
name: CHANGELOG Validation
# author: "Guillem Gari <[email protected]>"
# description: |
# This workflow validates the CHANGELOG.md file in pull requests and can
# be manually triggered. It checks if the CHANGELOG has been updated in
# the PR and verifies its format adheres to the Keep a Changelog standard.
# Key features:
# - Runs on self-hosted Kubernetes runners
# - Triggers on pull request events (open, reopen, synchronize)
# - Checks if CHANGELOG.md has been modified in the PR
# - Validates CHANGELOG.md format (headers, versioning, sections)
# - Provides detailed error messages for failed checks
on:
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
jobs:
check-changelog-updated:
name: Check CHANGELOG Update
runs-on:
- self-hosted
- internal-robotnik
- linux
- kubernetes
steps:
- uses: actions/checkout@v4
- name: Verify CHANGELOG.md Modification
run: |
BASE_BRANCH=${{ github.base_ref }}
git fetch origin $BASE_BRANCH
if git diff --name-only origin/$BASE_BRANCH..HEAD | grep -q "CHANGELOG.md"; then
echo "CHANGELOG.md has been modified in this PR."
else
echo "Error: CHANGELOG.md has not been updated in this PR."
exit 1
fi
check-changelog-format:
name: Validate CHANGELOG Format
runs-on:
- self-hosted
- internal-robotnik
- linux
- kubernetes
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Validate CHANGELOG.md Format
run: |
# Check if file exists
if [ ! -f CHANGELOG.md ]; then
echo "Error: CHANGELOG.md does not exist."
exit 1
fi
# Check for "Changelog" header
if ! grep -q "# Changelog" CHANGELOG.md; then
echo "Error: CHANGELOG.md is missing the '# Changelog' header."
exit 1
fi
# Check for semantic versioning headers
if ! grep -qE "## \[?[0-9]+\.[0-9]+\.[0-9]+\]?" CHANGELOG.md; then
echo "Error: CHANGELOG.md is missing proper semantic versioning headers."
exit 1
fi
# Check for change type sections
CHANGE_TYPES=("Added" "Changed" "Deprecated" "Removed" "Fixed" "Security")
for type in "${CHANGE_TYPES[@]}"; do
if ! grep -q "### $type" CHANGELOG.md; then
echo "Warning: CHANGELOG.md is missing the '### $type' section."
fi
done
echo "CHANGELOG.md format validation passed."