mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-17 18:19:04 +02:00
mixin: lint dashboards and migrate CI tasks to mise (#2608)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
@@ -44,13 +44,26 @@ jobs:
|
||||
|
||||
- name: check
|
||||
run: |
|
||||
PR_TITLE_PREFIX=$(echo "$PR_TITLE" | cut -d':' -f1)
|
||||
if [[ -d "internal/collector/$PR_TITLE_PREFIX" ]] || [[ -d "internal/$PR_TITLE_PREFIX" ]] || [[ -d "pkg/$PR_TITLE_PREFIX" ]] || [[ -d "$PR_TITLE_PREFIX" ]] || [[ "$PR_TITLE_PREFIX" == "docs" ]] || [[ "$PR_TITLE_PREFIX" == "ci" ]] || [[ "$PR_TITLE_PREFIX" == "revert" ]] || [[ "$PR_TITLE_PREFIX" == "fix" ]] || [[ "$PR_TITLE_PREFIX" == "fix(deps)" ]] || [[ "$PR_TITLE_PREFIX" == "feat" ]] || [[ "$PR_TITLE_PREFIX" == "chore" ]] || [[ "$PR_TITLE_PREFIX" == "chore(docs)" ]] || [[ "$PR_TITLE_PREFIX" == "chore(github-actions)" ]] || [[ "$PR_TITLE_PREFIX" == "chore(deps)" ]] || [[ "$PR_TITLE_PREFIX" == "*" ]] || [[ "$PR_TITLE_PREFIX" == "Release"* ]] || [[ "$PR_TITLE_PREFIX" == "Synchronize common files from prometheus/prometheus" ]] || [[ "$PR_TITLE_PREFIX" == "[0."* ]] || [[ "$PR_TITLE_PREFIX" == "[1."* ]]; then
|
||||
exit 0
|
||||
PR_TITLE_PREFIX="${PR_TITLE%%:*}"
|
||||
SCOPED_PREFIX_PATTERN='^([^():]+)\(.*\)(:|$)'
|
||||
if [[ "$PR_TITLE" =~ $SCOPED_PREFIX_PATTERN ]]; then
|
||||
PR_TITLE_PREFIX="${BASH_REMATCH[1]}"
|
||||
fi
|
||||
|
||||
echo "PR title must start with an name of an collector package"
|
||||
echo "Example: 'logical_disk: description'"
|
||||
for directory in internal/collector internal pkg .; do
|
||||
if [[ -d "$directory/$PR_TITLE_PREFIX" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
case "$PR_TITLE_PREFIX" in
|
||||
docs|ci|revert|fix|feat|chore|mixin|main|'*'|Release*|'Synchronize common files from prometheus/prometheus'|'[0.'*|'[1.'*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "PR title must start with a package name or an allowed prefix, optionally followed by a scope"
|
||||
echo "Examples: 'logical_disk: description', 'mixin(dashboard): description', 'chore(github-action): description'"
|
||||
exit 1
|
||||
env:
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
|
||||
Reference in New Issue
Block a user