How to automate refresh JWT token for GithubApp #160220
Replies: 5 comments 4 replies
-
|
Hi Ramya, You're on the right track using the GitHub App authentication flow for Renovate. The good news is: Renovate can handle token generation and refreshing automatically, without the need for custom scripts, if you provide the correct credentials and use the GitHub App configuration properly. Renovate can automatically authenticate as a GitHub App if you provide these three things in your config:
These are environment variables or can be passed as CLI arguments. Here’s how you can run Renovate with the built-in GitHub App integration: podman run --rm \
-e LOG_LEVEL=debug \
-e RENOVATE_CONFIG_FILE=/usr/src/app/config.js \
-e GITHUB_APP_ID=123456 \
-e GITHUB_INSTALLATION_ID=7890123 \
-e GITHUB_PRIVATE_KEY="$(cat /path/to/private-key.pem)" \
-v /home/renovate-runner/renovate-config.js:/usr/src/app/config.js \
docker.io/renovate/renovate
If you pass those three env variables, Renovate will automatically:
So you no longer need to generate the token with You're correct — the official docs mention this setup here: |
Beta Was this translation helpful? Give feedback.
-
|
When I try the way described by you, I face the below error: DEBUG: Using RE2 regex engine }; |
Beta Was this translation helpful? Give feedback.
-
|
To automate JWT refresh for a GitHub App: 1- Generate a new JWT using your app's private key (valid for 10 mins). 2- Use the JWT to request an installation access token (valid for 1 hour). 3 Repeat when the token expires or on 401 Unauthorized. This can be scripted in any language (e.g., Python or Node.js) and triggered on demand or with a timer. |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
GitHub Feature Area
APIs and Webhooks
Body
Hello,
I have tried using github app, and tried creating merge request by running podman
podman run --rm --volume /home/renovate-runner/renovate-local-tokens/renovate-config.js:/usr/src/app/config.js -e LOG_LEVEL=debug docker.io/renovate/renovate
I have tried creating JWT token , with the requirements such as APPID, Installation token and the github Privatekey
And then using curl I generated a token which can be used on my config.js , such that the merge request got created successfully.
Now how can I use the renoavte inbuilt functionality such that the refresh and exchange of the access token happens by its own, without using any scripts?
I have also seen
https://docs.renovatebot.com/modules/platform/github/
Where third party tools can be directly used to create these access tokens.
Can you point me how can I refresh and exchange these tokens with inbuilt functionality.
Your help is much appreciated.
Thanks,
Ramya
Beta Was this translation helpful? Give feedback.
All reactions