[chore] Fix the update-otel job #279
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Update contrib to the latest core source' | |
on: | |
workflow_dispatch: | |
# TODO: Remove before merging. | |
pull_request: | |
types: [ opened, synchronize, reopened, labeled, unlabeled ] | |
branches: | |
- main | |
# TODO: Enable schedule once it's verified that the action works as expected. | |
# schedule: | |
# - cron: "27 21 * * *" # Run at an arbitrary time on weekdays. | |
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 and push | |
run: | | |
cd opentelemetry-collector-contrib | |
git config user.name opentelemetrybot | |
git config user.email [email protected] | |
make genotelcontribcol | |
make update-otel | |
git add . | |
git commit -m "[chore] Update to latest opentelemetry-collector release" | |
git push origin "opentelemetrybot/update-otel-$(date +%s)" | |
gh pr create --title "[chore] Prepare release ${CANDIDATE_BETA}" --body "This PR updates the opentelemetry-collector dependency to the latest release" | |
env: | |
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} |