Skip to content
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

Add renovate github action #575

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/dependabot.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/approve-renovate-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Approve Renovate Pull Request"

on:
pull_request:
branches: [main]

# Increase the access for the GITHUB_TOKEN
permissions:
# This Allows the GITHUB_TOKEN to approve pull requests
pull-requests: write
# This Allows the GITHUB_TOKEN to auto merge pull requests
contents: write

env:
PR_URL: ${{github.event.pull_request.html_url}}
# By default, GitHub Actions workflows triggered by renovate get a GITHUB_TOKEN with read-only permissions.
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

jobs:
approve_renovate_pull_requests:
runs-on: ubuntu-latest
name: Approve renovate pull request
if: ${{ (github.actor == 'Octobob') && (contains(github.head_ref, 'renovate')) }}
steps:
- name: Approve a renovate created PR
run: gh pr review --approve "$PR_URL"
28 changes: 28 additions & 0 deletions .github/workflows/update-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Renovate update dependencies
on:
schedule:
# UTC 10:00 PM (8AM AEST, Monday - Thursday)
- cron: '0 22 * * 1-5'
workflow_dispatch:
inputs:
dry-run:
description: 'Dry run'
required: false
default: true
type: boolean

jobs:
renovate-backend:
name: Self-hosted Renovate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Self-hosted Renovate
uses: renovatebot/github-action@v39.0.1
with:
configurationFile: renovate-config.js
token: ${{ secrets.RENOVATE_GITHUB_TOKEN }}
env:
LOG_LEVEL: debug
RENOVATE_DRY_RUN: ${{ inputs.dry-run && 'full' || null }}
42 changes: 42 additions & 0 deletions renovate-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const excludeList = [
"dotnet-sdk", // The dotnet SDK update is a non-trivial piece of work.
];

module.exports = {

timezone: "Australia/Brisbane",
requireConfig: "optional",
onboarding: false,

ignoreDeps: excludeList,
enabledManagers: ["nuget"],

// Full list of built-in presets: https://docs.renovatebot.com/presets-default/
extends: [
"config:base",
"group:monorepos",
"group:recommended",
":rebaseStalePrs",
":automergeRequireAllStatusChecks",
],

// Renovate will create a new issue in the repository.
// This issue has a "dashboard" where you can get an overview of the status of all updates.
// https://docs.renovatebot.com/key-concepts/dashboard/
dependencyDashboard: true,
dependencyDashboardTitle: "Halibut Dependency Dashboard",

platform: "github",
repositories: ["OctopusDeploy/Halibut"],
reviewers: ["OctopusDeploy/team-server-at-scale"],
labels: ["dependencies", "Halibut"],
branchPrefix: "renovate-dotnet/",

// Limit the amount of PRs created
prConcurrentLimit: 2,
prHourlyLimit: 1,

// If set to false, Renovate will upgrade dependencies to their latest release only. Renovate will not separate major or minor branches.
// https://docs.renovatebot.com/configuration-options/#separatemajorminor
separateMajorMinor: false,
};