Skip to content

Commit

Permalink
Fix registry version updater
Browse files Browse the repository at this point in the history
Signed-off-by: svrnm <[email protected]>
  • Loading branch information
svrnm committed Nov 26, 2024
1 parent f7c0ac7 commit 2a70ba2
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 12 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/scripts/update-registry-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ for yaml_file in ${FILES}; do
echo "${yaml_file}: Package name and/or registry are missing in the YAML file."
else
# Get latest version
latest_version=$(get_latest_version "$name" "$registry")
latest_version=$(get_latest_version "$name" "$registry" || echo "Could not fetch version.")

if [ "$latest_version" == "Registry not supported." ]; then
if [ "$latest_version" == "Could not fetch version." ]; then
echo "${yaml_file} ($registry): Registry not supported.";
elif [ "$latest_version" == "Registry not supported." ]; then
echo "${yaml_file} ($registry): Registry not supported.";
elif [ -z "$latest_version" ]; then
echo "${yaml_file} ($registry): Could not get latest version from registry."
Expand Down Expand Up @@ -118,14 +120,22 @@ if [ "$existing_pr_count" -gt 0 ]; then
exit 0
fi

$NPM run fix:format
if [[ -n $(git status --porcelain) ]]; then
echo "Versions have been updated, formatting and pushing changes."

$NPM run fix:format

$GIT checkout -b "$branch"
$GIT commit -a -m "$message"
$GIT push --set-upstream origin "$branch"

$GIT checkout -b "$branch"
$GIT commit -a -m "$message"
$GIT push --set-upstream origin "$branch"
body_file=$(mktemp)
echo -en "${body}" >> "${body_file}"

body_file=$(mktemp)
echo -en "${body}" >> "${body_file}"
echo "Submitting auto-update PR '$message'."
$GH pr create --title "$message" --body-file "${body_file}"

echo "Submitting auto-update PR '$message'."
$GH pr create --title "$message" --body-file "${body_file}"
else
echo "No changes detected."
exit 0
fi
4 changes: 4 additions & 0 deletions data/registry/instrumentation-php-cakephp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ description:
authors:
- name: OpenTelemetry Authors
createdAt: 2024-07-08
package:
registry: packagist
name: open-telemetry/opentelemetry-auto-cakephp

Check warning on line 19 in data/registry/instrumentation-php-cakephp.yml

View workflow job for this annotation

GitHub Actions / SPELLING check

Unknown word (cakephp) Suggestions: (casephp, cagephp, carephp, capphp, catphp)
version: 0.0.3
isFirstParty: false
2 changes: 1 addition & 1 deletion data/registry/instrumentation-php-curl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ authors:
createdAt: 2024-11-18
package:
registry: packagist
name: opentelemetry-auto-curl
name: open-telemetry/opentelemetry-auto-curl
version: 0.0.1
isFirstParty: false
2 changes: 1 addition & 1 deletion data/registry/instrumentation-php-extrdkafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ authors:
createdAt: 2024-11-18
package:
registry: packagist
name: opentelemetry-auto-ext-rdkafka
name: open-telemetry/opentelemetry-auto-ext-rdkafka
version: 0.0.1
isFirstParty: false
4 changes: 4 additions & 0 deletions data/registry/instrumentation-php-psr6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ description:
authors:
- name: OpenTelemetry Authors
createdAt: 2024-07-08
package:
registry: packagist
name: open-telemetry/opentelemetry-auto-psr6
version: 0.0.3
isFirstParty: false

0 comments on commit 2a70ba2

Please sign in to comment.