Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/renovate-changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Add Changelog Entry for Renovate PRs

on:
pull_request:
types: [opened, synchronize]
branches:
- main

jobs:
add-changelog:
if: startsWith(github.head_ref, 'renovate/sumologic-kubernetes-collection')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}

- name: Create changelog entry
run: |
# Create PR-based filename
PR_NUMBER="${{ github.event.pull_request.number }}"
CHANGELOG_FILE=".changelog/${PR_NUMBER}.changed.txt"

# Ensure .changelog directory exists
mkdir -p .changelog

# Extract version information from git diff
OLD_VERSION=""
NEW_VERSION=""

# Check for version changes in values.yaml
if git diff HEAD~1 HEAD -- deploy/helm/sumologic/values.yaml | grep -E "tag.*sumo-"; then
OLD_VERSION=$(git diff HEAD~1 HEAD -- deploy/helm/sumologic/values.yaml | grep -E "^\-.*tag:" | head -1 | sed 's/.*tag: *["'"'"']*\([^"'"'"' ]*\)["'"'"']*.*/\1/' | grep "sumo-" || echo "")
NEW_VERSION=$(git diff HEAD~1 HEAD -- deploy/helm/sumologic/values.yaml | grep -E "^\+.*tag:" | head -1 | sed 's/.*tag: *["'"'"']*\([^"'"'"' ]*\)["'"'"']*.*/\1/' | grep "sumo-" || echo "")
fi

# Create changelog message
if [[ -n "$OLD_VERSION" && -n "$NEW_VERSION" ]]; then
CHANGELOG_TEXT="Upgraded otel collector version from $OLD_VERSION to $NEW_VERSION"
else
CHANGELOG_TEXT="chore(deps): Update dependencies"
fi

echo "$CHANGELOG_TEXT" > "$CHANGELOG_FILE"
echo "Created changelog file: $CHANGELOG_FILE with content: $CHANGELOG_TEXT"

- name: Commit changelog
run: |
# Configure git
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"

# Add and commit changelog
git add .changelog/
git commit -m "chore: Add changelog entry for dependency update"
git push origin ${{ github.head_ref }}
58 changes: 58 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"enabledManagers": ["custom.regex"],
"customManagers": [
{
"customType": "regex",
"description": "Update Sumo Logic container images in values.yaml (repository/tag pattern)",
"fileMatch": ["^deploy/helm/sumologic/values\\.yaml$"],
"matchStrings": [
"repository:\\s*\"?(?<depName>public\\.ecr\\.aws/sumologic/sumologic-otel-collector)\"?\\s*\\n\\s*tag:\\s*\"?(?<currentValue>[^\"\\s]+)\"?"
],
"datasourceTemplate": "docker",
"versioningTemplate": "regex:^(?<major>0)\\.(?<minor>[0-9]+)\\.(?<patch>[0-9]+)-sumo-(?<build>[0-9]+)$"
},
{
"customType": "regex",
"description": "Update Sumo Logic container images in test files",
"fileMatch": ["^tests/helm/testdata/goldenfile/.*\\.yaml$"],
"matchStrings": [
"image:\\s*\"?(?<depName>public\\.ecr\\.aws/sumologic/sumologic-otel-collector):(?<currentValue>[a-zA-Z0-9._-]+)\"?"
],
"datasourceTemplate": "docker",
"versioningTemplate": "regex:^(?<major>0)\\.(?<minor>[0-9]+)\\.(?<patch>[0-9]+)-sumo-(?<build>[0-9]+)$"
},
{
"customType": "regex",
"description": "Update version references in documentation tables",
"fileMatch": ["^deploy/helm/sumologic/README\\.md$"],
"matchStrings": [
"\\|\\s*`(sumologic\\.otelcolImage\\.tag|opentelemetry-operator\\.manager\\.collectorImage\\.tag)`\\s*\\|.*?\\|\\s*`(?<currentValue>[0-9.]+(?:-[a-z0-9-]+)?)`\\s*\\|"
],
"datasourceTemplate": "docker",
"depNameTemplate": "public.ecr.aws/sumologic/sumologic-otel-collector",
"versioningTemplate": "regex:^(?<major>0)\\.(?<minor>[0-9]+)\\.(?<patch>[0-9]+)-sumo-(?<build>[0-9]+)$"
},
{
"customType": "regex",
"description": "Update OpenTelemetry Collector version in docs README table",
"fileMatch": ["^docs/README\\.md$"],
"matchStrings": [
"\\|\\s*OpenTelemetry Collector\\s*\\|\\s*(?<currentValue>[0-9]+\\.[0-9]+\\.[0-9]+)\\s*\\|"
],
"datasourceTemplate": "docker",
"depNameTemplate": "public.ecr.aws/sumologic/sumologic-otel-collector",
"versioningTemplate": "loose",
"extractVersionTemplate": "^(?<version>[0-9]+\\.[0-9]+\\.[0-9]+)"
}
],
"packageRules": [
{
"description": "Group OpenTelemetry Collector updates together",
"matchDatasources": ["docker"],
"matchPackageNames": ["public.ecr.aws/sumologic/sumologic-otel-collector"],
"groupName": "sumologic-kubernetes-collection",
"separateMinorPatch": false,
"allowedVersions": "/^0\\.[0-9]+\\.[0-9]+(\\-sumo\\-[0-9]+)?$/"
}
]
}
Loading