Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Update OTEL Builder Dependencies
on:
push:
branches:
- dependabot/go_modules/src/otel-collector-builder/**
pull_request:
branches:
- dependabot/go_modules/src/otel-collector-builder/**

jobs:
post-hook:
# Only proceed if this is a Dependabot‐created PR
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.user.login == 'dependabot[bot]'
# Allow the job to approve and merge the PR
permissions:
contents: write
pull-requests: write
name: Update the OTEL collector
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: src/otel-collector/go.mod

- name: Update the OTEL builder version inside the configuration
run: |
extract_version() {
local s="$1"
[[ $s =~ ([0-9]+(\.[0-9]+){2})$ ]] && printf '%s\n' "${BASH_REMATCH[1]}"
}
otel_builder_version=$(extract_version "${{ github.ref_name }}")
sed -E -i '' "s#^(\\s*require\\s+go\\.opentelemetry\\.io/collector/cmd/builder\\s+)v?[0-9]+(\\.[0-9]+){2}#\\1v${otel_builder_version}#" src/otel-collector-builder/go.mod

- name: Build the new OTEL collector version
shell: bash
run: scripts/regenerate-otel-collector-distribution

- name: Run the Integrationtest
shell: bash
run: scripts/subtests/integration-test

- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "dependabot[bot]"
git commit -a -m "Adjust the OTEL builder version"

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}

Loading