Skip to content

Update dependencies #339

Update dependencies

Update dependencies #339

# 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.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@c5fdc9f98fdf9e9bb16b5760f7e560256eb79326 # v44.0.2
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'