Skip to content

Commit

Permalink
Merge pull request #39 from PierreBtz/pbeitz/dev
Browse files Browse the repository at this point in the history
Add CI validation for the release drafter configuration
  • Loading branch information
oleg-nenashev authored Apr 23, 2021
2 parents c068629 + 721b585 commit 4a78b2f
Show file tree
Hide file tree
Showing 3 changed files with 27 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'
}
}
20 changes: 20 additions & 0 deletions scripts/validateReleaseDrafterConfiguration.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/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}"

echo "Downloading the release drafter validation schema"
curl -Lso schema.json 'https://raw.githubusercontent.com/release-drafter/release-drafter/master/schema.json'

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

popd || exit

0 comments on commit 4a78b2f

Please sign in to comment.