-
Notifications
You must be signed in to change notification settings - Fork 277
add renovatebot to run hourly in a self-hosted github action instead of using dependabot #574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jessebot
wants to merge
8
commits into
nextcloud:main
Choose a base branch
from
jessebot:add-renovate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5fa07eb
add renovatebot to run hourly in a self-hosted github action instead …
jessebot 6ad09ae
update renovate GHA workflow to use github recommended action
jessebot 1093db4
fix on parameter to use pull_request directly
jessebot 1379d3a
Merge branch 'main' into add-renovate
jessebot 02b8ca4
bumps chart a patch version to please linter
jessebot e2ad1db
add allowedPostUpgradeCommand
jessebot f2258c8
remove options for app-token that aren't needed and use official gith…
jessebot ca6e06b
Merge branch 'main' into add-renovate
jessebot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"onboarding": false, | ||
"username": "renovate-release", | ||
"gitAuthor": "Renovate Bot <[email protected]>", | ||
"platform": "github", | ||
"repositories": [ | ||
"nextcloud/helm" | ||
], | ||
"allowedPostUpgradeCommands": ["^scripts"] | ||
} |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
name: Lint and Test Charts | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
on: pull_request | ||
|
||
jobs: | ||
changes: | ||
runs-on: ubuntu-latest-low | ||
|
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Renovate | ||
on: | ||
schedule: | ||
# This should be every hour | ||
- cron: '0 * * * *' | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- ".github/renovate-config.json" | ||
- ".github/workflows/renovate.yml" | ||
- "renovate.json" | ||
- "scripts/**" | ||
jobs: | ||
renovate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get token | ||
id: app-token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
private-key: ${{ secrets.PRIVATE_KEY }} | ||
app-id: ${{ secrets.APP_ID }} | ||
|
||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Self-hosted Renovate | ||
uses: renovatebot/[email protected] | ||
with: | ||
configurationFile: .github/renovate-config.json |
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"customManagers": [ | ||
{ | ||
"customType": "regex", | ||
"datasourceTemplate": "docker", | ||
"fileMatch": [ | ||
"(^|/)Chart\\.yaml$" | ||
], | ||
"matchStrings": [ | ||
"#\\s*renovate: image=(?<depName>.*?)\\s+appVersion:\\s*[\"']?(?<currentValue>[\\w+\\.\\-]*)" | ||
] | ||
} | ||
], | ||
"packageRules": [ | ||
{ | ||
"description": "Fix subchart archives for helm chart", | ||
"matchManagers": ["helmv3"], | ||
"postUpdateOptions": ["helmUpdateSubChartArchives"] | ||
}, | ||
{ | ||
"description": "Fix version in Chart.yaml after helmv3 dep patch updates", | ||
"matchManagers": ["helmv3"], | ||
"matchUpdateTypes": ["patch"], | ||
"bumpVersion": "patch" | ||
}, | ||
{ | ||
"description": "Fix version in Chart.yaml after helmv3 dep minor updates", | ||
"matchManagers": ["helmv3"], | ||
"matchUpdateTypes": ["minor"], | ||
"bumpVersion": "minor" | ||
}, | ||
{ | ||
"description": "Fix version in Chart.yaml after helmv3 dep major updates", | ||
"matchManagers": ["helmv3"], | ||
"matchUpdateTypes": ["major"], | ||
"bumpVersion": "major" | ||
}, | ||
{ | ||
"description": "Bump helm chart versions by a patch when updating values files. Digests, pins, rollbacks, replacements and pinDigest updates are deliberately ignored since in our use case, these need a manual decision about the version bump for the chart. This can be removed when https://github.com/renovatebot/renovate/issues/8231 is implemented and enabled.", | ||
"matchManagers": ["helm-values", "regex"], | ||
"postUpgradeTasks": { | ||
"commands": [ | ||
"bash scripts/bump-chart-version.sh '{{{updateType}}}'" | ||
], | ||
"fileFilters": ["**/Chart.yaml"] | ||
} | ||
} | ||
] | ||
} |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
parent_dir="$1" | ||
update_type="$2" | ||
|
||
version=$(grep "^version:" "charts/${parent_dir}/Chart.yaml" | awk '{print $2}') | ||
if [[ ! $version ]]; then | ||
echo "No valid version was found" | ||
exit 1 | ||
fi | ||
|
||
major=$(echo "$version" | cut -d. -f1) | ||
minor=$(echo "$version" | cut -d. -f2) | ||
patch=$(echo "$version" | cut -d. -f3) | ||
|
||
if [[ "$update_type" =~ (major|replacement) ]]; then | ||
major=$(( major + 1 )) | ||
minor=0 | ||
patch=0 | ||
elif [[ "$update_type" =~ 'minor' ]]; then | ||
minor=$(( minor + 1 )) | ||
patch=0 | ||
else | ||
patch=$(( patch + 1 )) | ||
fi | ||
|
||
echo "Bumping version for $parent_dir from $version to $major.$minor.$patch" | ||
sed -i "s/^version:.*/version: ${major}.${minor}.${patch}/g" "charts/${parent_dir}/Chart.yaml" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is here the Chart-name missed as first parameter? before updateType?