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 for dependency management #309

Merged
merged 1 commit into from
Dec 12, 2023
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
26 changes: 26 additions & 0 deletions .github/workflows/renovate-pull-request-automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Renovate Pull Request Approval

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
on:
schedule:
- cron: "30 1 * * *"

workflow_dispatch:
inputs:
dryRun:
type: boolean
required: false
default: false
description: Dry run (don't create PRs)

jobs:
renovate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Self-hosted Renovate
uses: renovatebot/github-action@0dbf03d3f50da30b8e523f51b628d2743c4934dc # v39.0.6
with:
configurationFile: renovate-config.js
token: ${{ secrets.RENOVATE_GITHUB_TOKEN }}
env:
LOG_LEVEL: debug
RENOVATE_DRY_RUN: ${{ inputs.dryRun && 'full' || null }}
33 changes: 33 additions & 0 deletions renovate-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// eslint-disable-next-line import/no-commonjs
module.exports = {
extends: [
'config:base',
':disableMajorUpdates',
':ignoreModulesAndTests',
':pinVersions',
':rebaseStalePrs',
':automergeDigest',
':automergePatch',
':automergePr',
':automergeRequireAllStatusChecks',
':automergeLinters',
':automergeTesters',
':automergeTypes',
'packages:eslint',
'workarounds:typesNodeVersioning',
'github>whitesource/merge-confidence:beta'
],
branchPrefix: 'renovate/',
platform: 'github',
repositories: ['OctopusDeploy/push-package-action'],
packageRules: [],
timezone: 'Australia/Brisbane',
onboarding: false,
requireConfig: false,
allowedPostUpgradeCommands: ['.*'],
postUpgradeTasks: {
commands: ['npm install && npm run build'],
fileFilters: ['**/index.js'],
executionMode: 'update'
}
}
14 changes: 9 additions & 5 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
{
"extends": "./tsconfig.json",
"include": [
"src",
"__tests__",
]
}
"src",
"__tests__",
"renovate-config.js"
],
"compilerOptions": {
"allowJs": true
}
}