From 5a9dcad637c8660ccef9b2a9c4ba0041f9e9aad4 Mon Sep 17 00:00:00 2001 From: Dominique RIGHETTO Date: Tue, 1 Nov 2022 15:49:11 +0100 Subject: [PATCH] Create check-file-for starting-slash --- .bin/check-file-for starting-slash | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .bin/check-file-for starting-slash diff --git a/.bin/check-file-for starting-slash b/.bin/check-file-for starting-slash new file mode 100644 index 000000000..d7d5a44b2 --- /dev/null +++ b/.bin/check-file-for starting-slash @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# Script to verify if a file contain any entries starting with a slash and show a warning into the github action result UI. +modified_file=$1 +echo "[+] Check $modified_file ..." +matches=$(grep -cE '^/[a-zA-Z0-9\._]+' $modified_file) +if [ $matches -ne 0 ] +then + echo "::warning file=$modified_file,line=1,col=1,endColumn=1::$matches entries start with a slash." +fi