Skip to content

Commit

Permalink
Merge pull request #209 from mikemcd3912/githubActions
Browse files Browse the repository at this point in the history
GitHub actions Update for Testers and Readme's
  • Loading branch information
elamaran11 authored Feb 9, 2024
2 parents 71cdf4e + 8262e56 commit 16dad95
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/new-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,31 @@ jobs:
for item in "${files[@]}"; do
status=$(echo "$item" | jq -r '.status')
filename=$(echo "$item" | jq -r '.filename')
echo $filename
if [ "$status" != removed ]; then
if [ "$status" != removed ] && [[ $filename != *README.md ]]; then
# Parse namespace data
subdirectory=$(dirname $filename)
namespace_file_subdirectory=$(dirname $filename)
namespace_file=$(find $namespace_file_subdirectory -name *namespace*)
namespace_name=""
# get namespace from dev branch partner directory
while [ -z "$(find $namespace_file_subdirectory -name '*namespace*')" ]; do
while [ -z "$(find $namespace_file_subdirectory -name '*namespace*')" ] && [[ -z $namespace_name ]]; do
namespace_file_subdirectory=$(dirname $namespace_file_subdirectory)
if [ $(basename $namespace_file_subdirectory) == "Partner" ] || [ $(basename $namespace_file_subdirectory) == "Core" ]; then
if [ $(basename $namespace_file_subdirectory) == "Testers" ]; then
namespace_name=$(yq e 'select(document_index==0).metadata.namespace' $filename)
elif [ $(basename $namespace_file_subdirectory) == "Partner" ] || [ $(basename $namespace_file_subdirectory) == "Core" ]; then
echo "No Namespace File Found in Partner Directory"
exit 200
fi
namespace_file=$(find $namespace_file_subdirectory -name "*namespace*")
done
if [ -f $namespace_file ]; then
if [[ -n $namespace_name ]]; then
namespace_file_subdirectory=$(dirname $filename)
elif [ -f $namespace_file ]; then
namespace_file_subdirectory=$(dirname $namespace_file)
namespace_name=$(grep -E '^\s*metadata:\s*$|^\s*name:\s*' "$namespace_file" | awk -F':' '{gsub(/ /, "", $2); print $2}')
else
Expand Down

0 comments on commit 16dad95

Please sign in to comment.