Skip to content

Use custom Github App to authenticate backport job #10394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 18, 2025

Conversation

cdce8p
Copy link
Member

@cdce8p cdce8p commented May 18, 2025

Followup to #10390

For organizations it's recommended to use custom Github Apps over PAT from bot accounts.
Created https://github.com/apps/pylint-backport-bot for it.

https://github.com/actions/create-github-app-token

@cdce8p cdce8p added Maintenance Discussion or action around maintaining pylint or the dev workflow Skip news 🔇 This change does not require a changelog entry backport maintenance/3.3.x labels May 18, 2025
@cdce8p cdce8p requested a review from Pierre-Sassoulas May 18, 2025 17:31
Copy link
Contributor

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit 0033c58

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is even better :) Is the app just an empty shell with some rights ? Otherwise where's the code for it ?

@DanielNoord
Copy link
Collaborator

Thanks @cdce8p for some of the recent PRs. Always good to have you around here 😄

@cdce8p
Copy link
Member Author

cdce8p commented May 18, 2025

Is the app just an empty shell with some rights ? Otherwise where's the code for it ?

Exactly. We somehow need to move beyond the GITHUB_TOKEN permissions. To do that the actions/create-github-app-token action authenticates the APP with the secret private key and get's an installation access token from it.

You can view the requested permissions here, but they are just the three explicitly listed in the backport.yml file. https://github.com/organizations/pylint-dev/settings/apps/pylint-backport-bot/permissions

Technically speaking the installation access token could have a slightly broader access than the PAT as it could be configured to access other org repos as well (i.e. astroid). That's one of the main use cases for it, to do inter org stuff. That config isn't the default though. https://github.com/actions/create-github-app-token?tab=readme-ov-file#owner

@cdce8p cdce8p merged commit 6be8676 into pylint-dev:main May 18, 2025
34 of 35 checks passed
@cdce8p cdce8p deleted the backport-github-app branch May 18, 2025 20:55
pylint-backport-bot bot pushed a commit that referenced this pull request May 18, 2025
cdce8p added a commit that referenced this pull request May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport maintenance/3.3.x Maintenance Discussion or action around maintaining pylint or the dev workflow Skip news 🔇 This change does not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants