Code Monkey home page Code Monkey logo

Comments (7)

rarkins avatar rarkins commented on June 10, 2024 4

It's in our docs that if you run as an app then you need to specify username: https://docs.renovatebot.com/modules/platform/github/#running-as-a-github-app

Why does Renovate need to know it's username? So that it can find and filter its own issues/PRs.

Why do you need to configure it manually when running as an app? Because an app installation token doesn't have any endpoint like /user which it can call to learn its identity - you have to tell it.

Please close this issue once you've confirmed it's working.

from github-action.

jdbruijn avatar jdbruijn commented on June 10, 2024

From the requests looks like it also wants read access to the user profile, could you please add that permission and try again? Just to confirm though, did you add the repositories you're running this on to the app?

image

from github-action.

ruzickap avatar ruzickap commented on June 10, 2024

Thank you for quick response.

I added the read-write access to the user profile:

image

I already had the app installed to the repository:

image

The problem persists:
https://github.com/ruzickap/test123/runs/6464969015?check_suite_focus=true

Thanks...

from github-action.

jdbruijn avatar jdbruijn commented on June 10, 2024

Looks like apps can't access the GET /user endpoint, as it isn't include in this list. Maybe @viceice or @rarkins can shed some light on why those requests are needed and/or other insights. From the setup I'd be expecting that other endpoints, that are in the list and have correct app permissions, would work just fine.

from github-action.

ruzickap avatar ruzickap commented on June 10, 2024

Thanks.

I tried to add the RENOVATE_USERNAME (see below) env variable to GH Action file, but it is still the same... :-(

env:
  LOG_LEVEL: info
  RENOVATE_CONFIG_FILE: .github/renovate.json5
  RENOVATE_DRY_RUN: false
  RENOVATE_REPOSITORIES: ${{ github.repository }}
#  RENOVATE_USERNAME: "renovate-bot"
  RENOVATE_USERNAME: "ruzickap"

https://github.com/ruzickap/test123/blob/7fc293049966040040825ad63cc50436012d6e0d/.github/workflows/renovate.yml#L31-L37

Log:
https://github.com/ruzickap/test123/runs/6466160523?check_suite_focus=true

from github-action.

rarkins avatar rarkins commented on June 10, 2024

@ruzickap Your username is wrong, and you also missed configuring gitAuthor. Please fully read this doc section before trying again: https://docs.renovatebot.com/modules/platform/github/#running-as-a-github-app

from github-action.

ruzickap avatar ruzickap commented on June 10, 2024

Thank you.
Now it is working like expected.
The final configuration yaml (if somebody else want to see it):

name: Renovate

on:
  workflow_dispatch:
    inputs:
      dryRun:
        type: choice
        description: "Dry-Run"
        default: "false"
        options:
          - true
          - false
        required: false
      logLevel:
        type: choice
        description: "Log-Level"
        default: "debug"
        options:
          - info
          - debug
          - trace
        required: false
  push:
    branches:
      - main
    paths:
      - ".github/renovate.json5"
  # schedule:
  #   - cron: "0 * * * *"

env:
  LOG_LEVEL: info
  RENOVATE_CONFIG_FILE: .github/renovate.json5
  RENOVATE_DRY_RUN: false
  RENOVATE_REPOSITORIES: ${{ github.repository }}
  RENOVATE_USERNAME: ${{ github.repository_owner }}
  RENOVATE_GIT_AUTHOR: "Renovate Bot <[email protected]>"

jobs:
  renovate:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Generate Token
        uses: tibdex/github-app-token@v1
        id: generate-token
        with:
          app_id: ${{ secrets.MY_RENOVATE_GITHUB_APP_ID }}
          private_key: "${{ secrets.MY_RENOVATE_GITHUB_PRIVATE_KEY }}"

      - name: Override default config from dispatch variables
        run: |
          echo "RENOVATE_DRY_RUN=${{ github.event.inputs.dryRun || env.RENOVATE_DRY_RUN }}" | tee -a "${GITHUB_ENV}"
          echo "LOG_LEVEL=${{ github.event.inputs.logLevel || env.LOG_LEVEL }}" | tee -a "${GITHUB_ENV}"
          echo "RENOVATE_BASE_BRANCHES=${GITHUB_REF##*/}" | tee -a "${GITHUB_ENV}"

      - name: Self-hosted Renovate
        uses: renovatebot/[email protected]
        with:
          configurationFile: "${{ env.RENOVATE_CONFIG_FILE }}"
          token: "x-access-token:${{ steps.generate-token.outputs.token }}"

Thank you guys...

from github-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.