[chore] add a job to update-otel daily #2
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: | |
pull_request: | |
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 | |
repository: open-telemetry/opentelemetry-collector | |
ref: main | |
- uses: actions/checkout@v4 | |
with: | |
path: opentelemetry-collector-contrib | |
- name: Update to latest opentelemetry-collector release | |
run: cd opentelemetry-collector-contrib && make update-otel | |
- name: Create pull request against main | |
env: | |
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows | |
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} | |
run: | | |
cd opentelemetry-collector-contrib | |
message="[chore] Update to latest opentelemetry-collector" | |
body="Update to latest opentelemetry-collector release." | |
branch="opentelemetrybot/update-otel" | |
git checkout -b $branch | |
git commit -a -m "$message" | |
git push --set-upstream origin $branch | |
url=$(gh pr create --title "$message" \ | |
--body "$body" \ | |
--base main) | |
pull_request_number=${url//*\//} | |
git push | |