name: renovate

on:
  workflow_dispatch:
  schedule:
    - cron: '0 0 * * 0'

jobs:
  renovate:
    runs-on: ubuntu-latest
    container: ghcr.io/renovatebot/renovate:latest@sha256:17c8966ef38fc361e108a550ffe2dcedf73e846f9975a974aea3d48c66b107a6
    steps:
      - uses: https://gitea.com/actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5

      - name: Set up Node.js
        uses: https://gitea.com/actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
        with:
          node-version: 20

      - name: Install uv manually
        run: |
          curl -LsSf https://astral.sh/uv/install.sh | sh
          . $HOME/.local/bin/env
          uv --version

      - name: Download external renovate config
        run: |
          mkdir -p /tmp/renovate-config
          curl -fsSL "https://git.linux-gaming.ru/Linux-Gaming/renovate-config/raw/branch/main/config.js" \
            -o /tmp/renovate-config/config.js

      - name: Run Renovate
        run: renovate
        env:
          RENOVATE_CONFIG_FILE: "/tmp/renovate-config/config.js"
          LOG_LEVEL: "debug"
          RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
          RENOVATE_GITHUB_COM_TOKEN: ${{ secrets.RENOVATE_GITHUB_COM_TOKEN }}
