name: Renovate

on:
  workflow_dispatch:
    inputs:
      logLevel:
        description: 'Log Level'
        required: true
        default: 'info'
        type: choice
        options:
          - info
          - debug
          - warning
  schedule:
    - cron: '0 8 */3 * *'

jobs:
  renovate:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

      - name: Generate GitHub token
        uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3
        id: generate-token
        with:
          app-id: ${{ secrets.RENOVATE_APP_ID }}
          private-key: ${{ secrets.RENOVATE_PRIVATE_KEY }}

      - name: Run renovate
        uses: renovatebot/github-action@83ec54fee49ab67d9cd201084c1ff325b4b462e4 # v46.1.10
        env:
          LOG_LEVEL: ${{ inputs.logLevel }}
          RENOVATE_REPOSITORIES: ${{ github.repository }}
        with:
          token: ${{ steps.generate-token.outputs.token }}
