Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI validation for the release drafter configuration #39

Merged
merged 2 commits into from Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
*.iml
.idea/*
5 changes: 5 additions & 0 deletions Jenkinsfile
@@ -0,0 +1,5 @@
node('node') {
PierreBtz marked this conversation as resolved.
Show resolved Hide resolved
stage('Release drafter configuration validation') {
sh './scripts/validateReleaseDrafterConfiguration.sh'
}
}
21 changes: 21 additions & 0 deletions scripts/validateReleaseDrafterConfiguration.sh
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -euo pipefail

HERE="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
RELEASE_DRAFTER_CONFIG="$HERE/../.github/release-drafter.yml"

AJV_VERSION='3.2.0'

pushd $TMPDIR || exit
PierreBtz marked this conversation as resolved.
Show resolved Hide resolved
echo "Installing AJV"
npm install -s -g "ajv-cli@${AJV_VERSION}"
PierreBtz marked this conversation as resolved.
Show resolved Hide resolved

# TODO the schema should come from json schema once https://github.com/release-drafter/release-drafter/pull/600 is fixed
echo "Downloading the release drafter validation schema"
curl -Lso schema.json 'https://raw.githubusercontent.com/release-drafter/release-drafter/cec90728b088fe0fbc42bc15dd3d21bc59db34c6/schema.json'

echo "Validating release drafter configuration"
ajv validate -s schema.json -d "${RELEASE_DRAFTER_CONFIG}"

popd || exit