Skip to content

Update dependencies #420

Update dependencies

Update dependencies #420

# Self-hosted dependency updates.
#
# Add the following environment variables to the GitHub actions project:
# - RENOVATE_TOKEN: GitHub access token.
# - RENOVATE_GIT_AUTHOR: Author for Renovate commits as `Name <[email protected]>`.
# Variables provided below can be overridden in the GitHub project settings.
#
# This workflow can be run manually to initiate immediate updates.
# An additional flag can be set to preserve the configured schedules and skip
# updates if they are not due. This allows to replicate automated scheduled runs.
name: Update dependencies
on:
schedule:
- cron: '45 11,23 * * *'
workflow_dispatch:
inputs:
preserve_schedules:
description: 'Use defined schedules and skip updates if they are not due.'
required: false
default: false
type: boolean
jobs:
update-dependencies:
runs-on: ubuntu-latest
steps:
- name: Check requirements
id: check-requirements
run: |
if [ -z "${{ secrets.RENOVATE_TOKEN }}" ]; then
echo "Renovate token is not set. Skipping job."
exit 0
fi
if [ -z "${{ vars.RENOVATE_GIT_AUTHOR }}" ]; then
echo "Renovate git author is not set. Skipping job."
exit 0
fi
echo "should_run=true" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: 22.17.1
- name: Process manual trigger
if: github.event_name == 'workflow_dispatch' && inputs.preserve_schedules == false
run: jq 'walk(if type == "object" then del(.schedule) else . end)' renovate.json > renovate.tmp.json && mv -f renovate.tmp.json renovate.json
- name: Show Renovate configuration
run: cat renovate.json
- name: Validate Renovate configuration
uses: suzuki-shunsuke/github-action-renovate-config-validator@c22827f47f4f4a5364bdba19e1fe36907ef1318e # v1.1.1
- name: Run Renovate
if: steps.check-requirements.outputs.should_run == 'true'
uses: renovatebot/github-action@f7fad228a053c69a98e24f8e4f6cf40db8f61e08 # v44.2.1
with:
configurationFile: renovate.json
token: ${{ secrets.RENOVATE_TOKEN }}
env:
RENOVATE_PLATFORM: 'github'
RENOVATE_AUTODISCOVER: false
RENOVATE_REPOSITORIES: ${{ vars.RENOVATE_REPOSITORIES || github.repository }}
RENOVATE_DEPENDENCY_DASHBOARD_TITLE: 'Renovate Dependency Dashboard (self-hosted) by GitHub Actions'
RENOVATE_DEPENDENCY_DASHBOARD: ${{ vars.RENOVATE_DEPENDENCY_DASHBOARD || 'false' }}
RENOVATE_DRY_RUN: ${{ vars.RENOVATE_DRY_RUN || 'false' }}
RENOVATE_GIT_AUTHOR: ${{ vars.RENOVATE_GIT_AUTHOR }}
LOG_LEVEL: 'debug'