-
Notifications
You must be signed in to change notification settings - Fork 120
Add support for enterprise level GitHub Apps #263
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
cbc2930
55b8c24
3c69395
46f9f78
7434028
81e8c22
a84c82d
7b86061
3b3f07c
22e6bc6
6cf7b5f
14350b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -4,6 +4,7 @@ import pRetry from "p-retry"; | |||
| /** | ||||
| * @param {string} appId | ||||
| * @param {string} privateKey | ||||
| * @param {string} enterprise | ||||
theztefan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||
| * @param {string} owner | ||||
| * @param {string[]} repositories | ||||
| * @param {undefined | Record<string, string>} permissions | ||||
|
|
@@ -15,58 +16,70 @@ import pRetry from "p-retry"; | |||
| export async function main( | ||||
| appId, | ||||
| privateKey, | ||||
| enterprise, | ||||
theztefan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||
| owner, | ||||
| repositories, | ||||
| permissions, | ||||
| core, | ||||
| createAppAuth, | ||||
| request, | ||||
| skipTokenRevoke | ||||
| ) { | ||||
| let parsedOwner = ""; | ||||
| let parsedRepositoryNames = []; | ||||
|
|
||||
| // If neither owner nor repositories are set, default to current repository | ||||
| if (!owner && repositories.length === 0) { | ||||
| const [owner, repo] = String(process.env.GITHUB_REPOSITORY).split("/"); | ||||
| parsedOwner = owner; | ||||
| parsedRepositoryNames = [repo]; | ||||
|
|
||||
| core.info( | ||||
| `Inputs 'owner' and 'repositories' are not set. Creating token for this repository (${owner}/${repo}).` | ||||
| ); | ||||
| } | ||||
| skipTokenRevoke, | ||||
|
|
||||
|
||||
theztefan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently we do not have a way to get the installation for an enterprise directly, so as a workaround we need to list all installations and filter for the enterprise one.
Unfortunately, we will probably need to wait until there is a way to get the installation for an enterprise directly. Otherwise, we'll need to add pagination support for this to be reliable. This could be done via Octokit, but we've tried to keep dependencies to a minimum and would prefer to keep it that way.
Uh oh!
There was an error while loading. Please reload this page.