Check for new instrumentation versions #816
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: Check for new instrumentation versions | |
# Description: | |
# This workflow is responsible for checking for new versions of Splunk instrumentation libraries | |
# used in operator based auto-instrumentation and updating the values.yaml if necessary. | |
on: | |
schedule: | |
# Run every 12th hour at minute 45 past. | |
- cron: "45 */12 * * *" | |
workflow_dispatch: | |
inputs: | |
DEBUG_MODE: | |
description: 'Enable debug mode' | |
required: false | |
default: 'false' | |
env: | |
VALUES_YAML: helm-charts/splunk-otel-collector/values.yaml | |
LATEST_API: https://api.github.com/repos/signalfx/splunk-otel-{lang}/releases/latest | |
jobs: | |
maybe_update: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# Add languages that require version updates here | |
language: ['java', 'nodejs'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Update Version | |
id: swizzle_version | |
run: | | |
echo "Update Splunk Operator Instrumentation for ${{ matrix.language }}" | |
# Set debug argument if DEBUG_MODE is true | |
DEBUG_ARG="" | |
if [ "${{ github.event.inputs.DEBUG_MODE }}" == "true" ]; then | |
DEBUG_ARG="--debug" | |
fi | |
# Run the update script and handle errors | |
./ci_scripts/update-images-operator-splunk.sh ${{ matrix.language }} $DEBUG_ARG || exit 1 | |
# Check if an update is needed | |
if [ "$NEED_UPDATE" -eq 0 ]; then | |
echo "No updates detected. Exiting." | |
exit 0 | |
fi | |
echo "Rendering chart template..." | |
make render | |
echo "Displaying current git diff..." | |
git --no-pager diff | |
- name: PR the new version | |
if: ${{ steps.swizzle_version.outputs.NEED_UPDATE == 1 }} | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
commit-message: Update ${{ matrix.language }} instrumentation version | |
title: Update ${{ matrix.language }} instrumentation version to ${{ steps.swizzle_version.outputs.LATEST_VER }} | |
body: Use the new version of the ${{ matrix.language }} instrumentation | |
branch: "update-${{ matrix.language }}-${{ steps.swizzle_version.outputs.LATEST_VER }}" | |
base: main | |
delete-branch: true | |
modify-outputs: false |