Repository navigation
Add Renovate workflow for Docker base image updates #86
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,44 @@ | ||||||||||||||||||||||
| name: Renovate | ||||||||||||||||||||||
| on: | ||||||||||||||||||||||
| schedule: | ||||||||||||||||||||||
| - cron: "0 8 * * 1-5" # Weekdays at 8am UTC | ||||||||||||||||||||||
| workflow_dispatch: # Allow manual trigger | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||
| renovate: | ||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||
| permissions: {} | ||||||||||||||||||||||
| steps: | ||||||||||||||||||||||
| - name: Generate app token | ||||||||||||||||||||||
| id: app-token | ||||||||||||||||||||||
| uses: actions/create-github-app-token@v3 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| app-id: ${{ vars.ACTIONS_APP_ID }} | ||||||||||||||||||||||
| private-key: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }} | ||||||||||||||||||||||
| owner: ${{ github.repository_owner }} | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Checkout | ||||||||||||||||||||||
| uses: actions/checkout@v6 | ||||||||||||||||||||||
|
||||||||||||||||||||||
| uses: actions/checkout@v6 | |
| uses: actions/checkout@v4 |
Copilot
AI
Apr 30, 2026
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.
This auto-approval logic selects PRs purely by branch prefix, so it will also “approve” Renovate major updates even though the Renovate config distinguishes major updates (adds a major label). If the intent is to only auto-approve safer updates, filter by update type/labels (e.g., only approve when the PR does not have the major label, or only when it has an allowlisted label set).
| gh pr list --repo ${{ github.repository }} --state open --json number,headRefName --jq '.[] | select(.headRefName | startswith("improvement/renovate-")) | .number' | while read -r pr; do | |
| gh pr list --repo ${{ github.repository }} --state open --json number,headRefName,labels --jq '.[] | select((.headRefName | startswith("improvement/renovate-")) and ((.labels | map(.name) | index("major")) == null)) | .number' | while read -r pr; do |
Copilot
AI
Apr 30, 2026
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.
The “Auto-approve Renovate PRs” step doesn’t actually approve PRs in GitHub; it only posts a /approve comment and then logs “Approved PR”. Unless you have an external bot that converts /approve comments into reviews, this won’t satisfy branch protection that requires an approving review. Consider using an actual review approval mechanism (e.g., gh pr review --approve with a token that has pull_requests: write) or rename the step/output to reflect what it really does.
| if ! gh pr view "$pr" --repo ${{ github.repository }} --json comments --jq '.comments[].body' | grep -q '^/approve$'; then | |
| gh pr comment "$pr" --repo ${{ github.repository }} --body '/approve' | |
| echo "Approved PR #$pr" | |
| else | |
| echo "PR #$pr already approved, skipping" | |
| if ! gh pr view "$pr" --repo ${{ github.repository }} --json reviews --jq '.reviews[].state' | grep -q '^APPROVED$'; then | |
| gh pr review "$pr" --repo ${{ github.repository }} --approve | |
| echo "Approved PR #$pr" | |
| else | |
| echo "PR #$pr already has an approving review, skipping" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
| "extends": ["config:recommended"], | ||
| "enabledManagers": ["dockerfile"], | ||
| "branchPrefix": "improvement/renovate-", | ||
| "packageRules": [ | ||
| { | ||
| "matchManagers": ["dockerfile"], | ||
| "matchUpdateTypes": ["minor", "patch"], | ||
| "addLabels": ["dependencies", "docker", "renovate"] | ||
| }, | ||
| { | ||
| "matchManagers": ["dockerfile"], | ||
| "matchUpdateTypes": ["major"], | ||
| "addLabels": ["dependencies", "docker", "major", "renovate"] | ||
| } | ||
| ] | ||
| } |
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.
The workflow file is named
renovate.yaml, but the existing workflows in this repo use the.ymlextension (e.g.,docker.yml,release.yml,tests.yml). Consider renaming this torenovate.ymlfor consistency and easier discovery/grep across workflows.