jenkinsci / jenkinsci/github-branch-source-plugin

Generate API token valid for longer period than 1 hour

Open
#1,527 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
217
Forks
398
Avg merge
30m
Merged PRs (30d)
1

Description

### What feature do you want to see added?

We have a set of Jenkins jobs that run for up to two hours. These tests store credentials in a Managed File that agents use to access several resources. However, because the agents run for more than 1 hour, the initial set of calls to GitHub succeeds but the final one fails because the token has already expired.

From the documentation, it seems that Jenkins is using Authenticating as a GitHub App installation, using tokens that are valid for only 1 hour. Because we store that credential in a Managed File in a longer duration run, we don't have a chance to request a new token.

From GitHub App documentation, there's a possibility to use User access tokens created by a GitHub App which will expire after eight hours by default.

Our goal is to use GitHub App token as replacement for service/bot accounts which are used in automation, but the 1 hour restriction is too limiting for us. Is there any way to overcome this issue?

### Upstream changes

_No response_

### Are you interested in contributing this feature?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.