@@ -82,9 +82,11 @@ for yaml_file in ${FILES}; do
82
82
echo " ${yaml_file} : Package name and/or registry are missing in the YAML file."
83
83
else
84
84
# Get latest version
85
- latest_version=$( get_latest_version " $name " " $registry " )
85
+ latest_version=$( get_latest_version " $name " " $registry " || echo " Could not fetch version. " )
86
86
87
- if [ " $latest_version " == " Registry not supported." ]; then
87
+ if [ " $latest_version " == " Could not fetch version." ]; then
88
+ echo " ${yaml_file} ($registry ): Registry not supported." ;
89
+ elif [ " $latest_version " == " Registry not supported." ]; then
88
90
echo " ${yaml_file} ($registry ): Registry not supported." ;
89
91
elif [ -z " $latest_version " ]; then
90
92
echo " ${yaml_file} ($registry ): Could not get latest version from registry."
@@ -118,14 +120,22 @@ if [ "$existing_pr_count" -gt 0 ]; then
118
120
exit 0
119
121
fi
120
122
121
- $NPM run fix:format
123
+ if [[ -n $( git status --porcelain) ]]; then
124
+ echo " Versions have been updated, formatting and pushing changes."
125
+
126
+ $NPM run fix:format
127
+
128
+ $GIT checkout -b " $branch "
129
+ $GIT commit -a -m " $message "
130
+ $GIT push --set-upstream origin " $branch "
122
131
123
- $GIT checkout -b " $branch "
124
- $GIT commit -a -m " $message "
125
- $GIT push --set-upstream origin " $branch "
132
+ body_file=$( mktemp)
133
+ echo -en " ${body} " >> " ${body_file} "
126
134
127
- body_file= $( mktemp )
128
- echo -en " ${body} " >> " ${body_file} "
135
+ echo " Submitting auto-update PR ' $message '. "
136
+ $GH pr create --title " $message " --body-file " ${body_file} "
129
137
130
- echo " Submitting auto-update PR '$message '."
131
- $GH pr create --title " $message " --body-file " ${body_file} "
138
+ else
139
+ echo " No changes detected."
140
+ exit 0
141
+ fi
0 commit comments