forked from odigos-io/odigos
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 2.43 KB
/
update-otel-versions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Update OpenTelemetry Instrumentations
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
update_opentelemetry_instrumentations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch latest version of instrumentations
id: fetch_latest_version
run: |
java_latest_version=$(curl --silent "https://api.github.com/repos/open-telemetry/opentelemetry-java-instrumentation/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
echo "java_latest_version=${java_latest_version}" >> $GITHUB_OUTPUT
dotnet_latest_version=$(curl --silent "https://api.github.com/repos/open-telemetry/opentelemetry-dotnet-instrumentation/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
echo "dotnet_latest_version=${dotnet_latest_version}" >> $GITHUB_OUTPUT
echo "Latest version of opentelemetry-java-instrumentation is ${java_latest_version}"
echo "Latest version of opentelemetry-dotnet-instrumentation is ${dotnet_latest_version}"
- name: Replace versions in Dockerfile
run: |
cd odiglet
java_latest_version=${{ steps.fetch_latest_version.outputs.java_latest_version }}
sed -i "s/JAVA_OTEL_VERSION=.*/JAVA_OTEL_VERSION=${java_latest_version}/" Dockerfile
dotnet_latest_version=${{ steps.fetch_latest_version.outputs.dotnet_latest_version }}
sed -i "s/DOTNET_OTEL_VERSION=.*/DOTNET_OTEL_VERSION=${dotnet_latest_version}/" Dockerfile
- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
commit-message: 'Update Java instrumentation to ${{ steps.fetch_latest_version.outputs.java_latest_version }} and .NET instrumentation to ${{ steps.fetch_latest_version.outputs.dotnet_latest_version }}'
branch: automated/update-opentelemetry-instrumentations
delete-branch: true
title: '[auto] Update Java instrumentation to version ${{ steps.fetch_latest_version.outputs.java_latest_version }} and .NET instrumentation to version ${{ steps.fetch_latest_version.outputs.dotnet_latest_version }}'
body: "This pull request updates the Java instrumentation to version ${{ steps.fetch_latest_version.outputs.java_latest_version }} and the .NET instrumentation to version ${{ steps.fetch_latest_version.outputs.dotnet_latest_version }}. It was created automatically by a GitHub Action."