Skip to content

Commit

Permalink
Add CI validation for the release drafter configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreBtz committed Jul 23, 2020
1 parent 7baf618 commit 41425af
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.iml
.idea/*
5 changes: 5 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node('node') {
stage('Release drafter configuration validation') {
sh './scripts/validateReleaseDrafterConfiguration.sh'
}
}
21 changes: 21 additions & 0 deletions scripts/validateReleaseDrafterConfiguration.sh
Original file line number Diff line number Diff line change
@@ -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
echo "Installing AJV"
npm install -s -g "ajv-cli@${AJV_VERSION}"

# 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

0 comments on commit 41425af

Please sign in to comment.