Skip to content

Check for new collector versions #182

Check for new collector versions

Check for new collector versions #182

name: Check for new collector versions
# Description:
# This workflow is responsible for checking for new versions of the collector.
on:
schedule:
# Run every 12th hour at minute 40 past.
- cron: "40 */12 * * *"
workflow_dispatch:
jobs:
collector_update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update Version
id: update
run: |
LATEST_VER=$(curl -L -qs -H 'Accept: application/vnd.github+json' https://api.github.com/repos/signalfx/splunk-otel-collector/releases/latest | jq -r .tag_name)
sed -i "s/appVersion:.*/appVersion: ${LATEST_VER##v}/" helm-charts/splunk-otel-collector/Chart.yaml
make render
echo "Latest version: ${LATEST_VER}"
echo "LATEST_VER=${LATEST_VER}" >> "$GITHUB_OUTPUT"
if [[ -n $(git status --short) ]];then
echo "NEED_UPDATE=1" >> "$GITHUB_OUTPUT"
else
echo "NEED_UPDATE=0" >> "$GITHUB_OUTPUT"
fi
- name: PR the new version
if: ${{ steps.update.outputs.NEED_UPDATE == 1 }}
uses: peter-evans/create-pull-request@v5
with:
commit-message: Update collector version
title: Update collector version to ${{ steps.update.outputs.LATEST_VER }}
body: Use the new version of the collector
branch: "update-collector"
# The "Skip Changelog" label is applied because the ci_scripts/chloggen-update.sh script
# will automatically add information about the collector when a release is created.
labels: Skip Changelog
base: main
delete-branch: true