From 5b4672259a5bb346e94d6956bf4d190fd5571a42 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Fri, 9 Jun 2023 07:33:27 -0400 Subject: [PATCH] Auto check and update OTLP spec and its version (#2846) --- .github/workflows/auto-update-versions.yml | 1 + .github/workflows/scripts/auto-update-version.sh | 7 ++++--- package.json | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-update-versions.yml b/.github/workflows/auto-update-versions.yml index 3779e2e57a53..8db823072ff0 100644 --- a/.github/workflows/auto-update-versions.yml +++ b/.github/workflows/auto-update-versions.yml @@ -25,6 +25,7 @@ jobs: .github/workflows/scripts/auto-update-version.sh opentelemetry-java javaVersion content/en/docs/instrumentation/java/_index.md .github/workflows/scripts/auto-update-version.sh opentelemetry-java-instrumentation javaInstrumentationVersion content/en/docs/instrumentation/java/automatic/annotations.md .github/workflows/scripts/auto-update-version.sh opentelemetry-specification spec scripts/content-modules/adjust-pages.pl + .github/workflows/scripts/auto-update-version.sh opentelemetry-proto otlp scripts/content-modules/adjust-pages.pl env: # change this to secrets.GITHUB_TOKEN when testing against a fork GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} diff --git a/.github/workflows/scripts/auto-update-version.sh b/.github/workflows/scripts/auto-update-version.sh index 44599270c0b0..02795f96c3ef 100755 --- a/.github/workflows/scripts/auto-update-version.sh +++ b/.github/workflows/scripts/auto-update-version.sh @@ -69,11 +69,12 @@ if [ "$existing_pr_count" -gt 0 ]; then exit 0 fi -if [[ "$repo" == "opentelemetry-specification" ]]; then +if [[ "$repo" == "opentelemetry-specification" + || "$repo" == "opentelemetry-proto" ]]; then echo "Switching to $repo at tag v$latest_version" ( set -x; - npm run get:submodule -- content-modules/opentelemetry-specification && - cd content-modules/opentelemetry-specification && + npm run get:submodule -- content-modules/$repo && + cd content-modules/$repo && git fetch && git switch --detach v$latest_version ) diff --git a/package.json b/package.json index bbaf37883e05..be43a66bfb0a 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "spelling": "cSpell:ignore docsy elemetry HTMLTEST hugo netlify prebuild precheck preinstall postbuild textlint -", + "spelling": "cSpell:ignore docsy elemetry HTMLTEST hugo netlify prebuild precheck preinstall postbuild postget textlint -", "Notes": [ "The 'all' and 's' scripts are conveniences for use until the following", "is fixed: https://github.com/mysticatea/npm-run-all/issues/209.", @@ -41,6 +41,7 @@ "make:public": "make public ls-public", "postbuild:preview": "npm run _check:links--warn", "postbuild:production": "npm run _check:links--warn", + "postget:submodule": "git submodule", "prebuild:preview": "run-s _prebuild", "prebuild:production": "run-s _prebuild _check:format", "prebuild": "npm run _prebuild",