Skip to content

Commit

Permalink
Offer collector updates automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme committed Oct 18, 2023
1 parent da261f5 commit 9449dc1
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/update_collector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
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:


env:
VALUES_YAML: helm-charts/splunk-otel-collector/values.yaml
LATEST_API: https://api.github.com/repos/signalfx/splunk-otel-collector/releases/latest

jobs:
maybe_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
git diff --exit-code
NEED_UPDATE=$?
echo "LATEST_VER=${LATEST_VER}" >> "$GITHUB_OUTPUT"
echo "NEED_UPDATE=${NEED_UPDATE}" >> "$GITHUB_OUTPUT"
- 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-${{ steps.swizzle_version.outputs.LATEST_VER }}"
base: main
delete-branch: true
modify-outputs: false

0 comments on commit 9449dc1

Please sign in to comment.