Skip to content

Commit

Permalink
fixup! Add support for organization and user installation retrieval a…
Browse files Browse the repository at this point in the history
…nd repository scoping
  • Loading branch information
tibdex committed Sep 9, 2023
1 parent 6576ee0 commit 7cad982
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@ jobs:
# The only required permission is `Repository permissions > Metadata: Read-only`.
app_id: ${{ vars.TEST_GITHUB_APP_ID }}
private_key: ${{ secrets.TEST_GITHUB_APP_PRIVATE_KEY }}
installation_retrieval_mode: organization
- run: node --eval "assert('${{ steps.generate_token.outputs.token }}'.length > 0);"
if: ${{ steps.generate_token.outcome != 'skipped' }}
16 changes: 2 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"@actions/github": "^5.1.1",
"@octokit/auth-app": "^6.0.0",
"@octokit/request": "^8.1.1",
"ensure-error": "^4.0.0",
"is-base64": "^1.1.0"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ try {
mode: installationRetrievalMode,
payload: installationRetrievalPayload,
});
debug(`Installation retrieval details: ${installationRetrievalDetails}.`);
debug(`Installation retrieval details: ${JSON.stringify(installationRetrievalDetails)}.`);

const permissionsInput = getInput("permissions");
const permissions = permissionsInput
? (JSON.parse(permissionsInput) as Record<string, string>)
: undefined;
debug(`Requested permissions: ${permissions}.`);
debug(`Requested permissions: ${JSON.stringify(permissions)}.`);

const privateKeyInput = getInput("private_key", { required: true });
const privateKey = isBase64(privateKeyInput)
Expand All @@ -47,7 +47,7 @@ try {
const repositories = repositoriesInput
? (JSON.parse(repositoriesInput) as string[])
: undefined;
debug(`Requested repositories: ${permissions}.`);
debug(`Requested repositories: ${JSON.stringify(repositories)}.`);

const token = await fetchInstallationToken({
appId,
Expand Down

0 comments on commit 7cad982

Please sign in to comment.