From f88f0208ea05842c6c21b06523510b678b795581 Mon Sep 17 00:00:00 2001 From: Dmitry Anoshin Date: Mon, 6 Jan 2025 11:59:00 -0800 Subject: [PATCH] [chore] Setup a job to run make update otel --- .github/workflows/update-otel.yaml | 34 ++++++++++++++++++++++++++++++ Makefile | 4 ++-- 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/update-otel.yaml diff --git a/.github/workflows/update-otel.yaml b/.github/workflows/update-otel.yaml new file mode 100644 index 000000000000..666372aa48df --- /dev/null +++ b/.github/workflows/update-otel.yaml @@ -0,0 +1,34 @@ +name: 'Update contrib to the latest core source' +on: + workflow_dispatch: + pull_request: # TODO: remove before merging + schedule: + - cron: "27 21 * * *" # Run at an arbitrary time on weekdays. + +# TODO: Skip if there is no new commits in the core source. +jobs: + update-otel: + runs-on: ubuntu-24.04 + if: ${{ github.repository_owner == 'open-telemetry' }} + steps: + - uses: actions/checkout@v4 + with: + path: opentelemetry-collector-contrib + - name: Pull the latest collector repo + uses: actions/checkout@v4 + with: + path: opentelemetry-collector + repository: open-telemetry/opentelemetry-collector + - name: Update to latest opentelemetry-collector release + run: | + cd opentelemetry-collector-contrib + git config user.name opentelemetrybot + git config user.email 107717825+opentelemetrybot@users.noreply.github.com + make update-otel + - name: Create pull request against main + uses: peter-evans/create-pull-request@v7 + with: + branch: opentelemetrybot/update-otel + token: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} + commit-message: Update to latest opentelemetry-collector release. + title: "[chore] Update to latest opentelemetry-collector" diff --git a/Makefile b/Makefile index 176ba2b07f85..d5985f7ba475 100644 --- a/Makefile +++ b/Makefile @@ -417,8 +417,8 @@ update-otel:$(MULTIMOD) $(MULTIMOD) sync -s=true -o ../opentelemetry-collector -m beta --commit-hash $(OTEL_VERSION) git add . && git commit -s -m "[chore] multimod update beta modules" ; \ $(MAKE) gotidy - $(call updatehelper,$(CORE_VERSIONS),$(GOMOD),./cmd/otelcontribcol/builder-config.yaml) - $(call updatehelper,$(CORE_VERSIONS),$(GOMOD),./cmd/oteltestbedcol/builder-config.yaml) + $(call updatehelper,$(CORE_VERSIONS),$(GOMOD),$(SRC_ROOT)/cmd/otelcontribcol/builder-config.yaml) + $(call updatehelper,$(CORE_VERSIONS),$(GOMOD),$(SRC_ROOT)/cmd/oteltestbedcol/builder-config.yaml) $(MAKE) genotelcontribcol $(MAKE) genoteltestbedcol $(MAKE) oteltestbedcol