diff --git a/.forgejo/workflows/renovate.yaml b/.forgejo/workflows/renovate.yaml index 35bd782..2a16880 100644 --- a/.forgejo/workflows/renovate.yaml +++ b/.forgejo/workflows/renovate.yaml @@ -26,43 +26,59 @@ jobs: with: show-progress: false - - name: Renovate + - name: Setup Docker auth run: | - echo "Testing docker login..." - docker login -u "${{ secrets.DOCKER_USERNAME }}" -p "${{ secrets.DOCKER_PASSWORD }}" - renovate ${{ env.INPUT_ARGS }} + mkdir -p $HOME/.docker + echo '{"auths":{"docker.io":{"auth":"${{ secrets.DOCKER_AUTH }}"}}}' > $HOME/.docker/config.json + chmod 600 $HOME/.docker/config.json + + - name: Renovate env: + # Global config + RENOVATE_BINARY_SOURCE: "docker" + RENOVATE_PLATFORM: gitea + RENOVATE_ENDPOINT: ${{ github.server_url }} + RENOVATE_TOKEN: ${{ github.repository == 'jahanson/renovate-config' && secrets.TOKEN || secrets.GITHUB_TOKEN }} + + # Git config + RENOVATE_GIT_AUTHOR: 'Renovate Bot ' + GIT_AUTHOR_NAME: 'Renovate Bot' + GIT_AUTHOR_EMAIL: 'smeagol@hsn.dev' + GIT_COMMITTER_NAME: 'Renovate Bot' + GIT_COMMITTER_EMAIL: 'smeagol@hsn.dev' + + # Authentication + GITHUB_COM_TOKEN: ${{ secrets.GH_TOKEN }} DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - GITHUB_COM_TOKEN: ${{ secrets.GH_TOKEN }} + + # Logging LOG_LEVEL: debug LOG_FORMAT: json - RENOVATE_ENDPOINT: ${{ github.server_url }} - RENOVATE_PLATFORM: gitea - RENOVATE_TOKEN: ${{ github.repository == 'jahanson/renovate-config' && secrets.TOKEN || secrets.GITHUB_TOKEN }} - RENOVATE_GIT_AUTHOR: 'Renovate Bot ' + LOG_FILE_LEVEL: debug + + # Host rules for registry authentication RENOVATE_HOST_RULES: |- [ { - "matchHost": "hub.docker.com", - "hostType": "", + "matchHost": "registry-1.docker.io", + "hostType": "docker", "username": "${{ secrets.DOCKER_USERNAME }}", "password": "${{ secrets.DOCKER_PASSWORD }}" }, { "matchHost": "ghcr.io", - "hostType": "", + "hostType": "docker", "username": "${{ secrets.GH_USERNAME }}", "password": "${{ secrets.GH_TOKEN }}" }, { "matchHost": "git.hsn.dev", - "username": "${{ secrets.DOCKER_USERNAME }}", + "hostType": "gitea", "token": "${{ secrets.MIRROR_TOKEN }}" } ] - GIT_AUTHOR_NAME: 'Renovate Bot' - GIT_AUTHOR_EMAIL: 'smeagol@hsn.dev' - GIT_COMMITTER_NAME: 'Renovate Bot' - GIT_COMMITTER_EMAIL: 'smeagol@hsn.dev' + + # Command execution INPUT_ARGS: ${{ inputs.args || (github.repository != 'jahanson/renovate-config' && github.repository) || '--autodiscover' }} + run: renovate ${{ env.INPUT_ARGS }}