From 09b36b3aa592f26356dd4c3ab0fba3656c5e47ce Mon Sep 17 00:00:00 2001 From: tpikachu <46133358+tpikachu@users.noreply.github.com> Date: Wed, 20 Mar 2024 05:40:36 -0500 Subject: [PATCH 1/2] personal access token as env --- .github/workflows/pr.yml | 2 + dist/index.js | 80 +++++++--------------------------------- src/index.js | 9 ++++- 3 files changed, 23 insertions(+), 68 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 60f3c4e..14325dc 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -16,3 +16,5 @@ jobs: 1. open youtube. 2. find a cat video 3. quit the browser + env: + PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} diff --git a/dist/index.js b/dist/index.js index 6ba3cb3..6214af0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3563,7 +3563,7 @@ __export(dist_src_exports, { module.exports = __toCommonJS(dist_src_exports); // pkg/dist-src/version.js -var VERSION = "9.2.0"; +var VERSION = "9.1.5"; // pkg/dist-src/normalize-paginated-list-response.js function normalizePaginatedListResponse(response) { @@ -3724,8 +3724,6 @@ var paginatingEndpoints = [ "GET /orgs/{org}/members/{username}/codespaces", "GET /orgs/{org}/migrations", "GET /orgs/{org}/migrations/{migration_id}/repositories", - "GET /orgs/{org}/organization-roles/{role_id}/teams", - "GET /orgs/{org}/organization-roles/{role_id}/users", "GET /orgs/{org}/outside_collaborators", "GET /orgs/{org}/packages", "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", @@ -3962,7 +3960,7 @@ __export(dist_src_exports, { module.exports = __toCommonJS(dist_src_exports); // pkg/dist-src/version.js -var VERSION = "10.4.0"; +var VERSION = "10.2.0"; // pkg/dist-src/generated/endpoints.js var Endpoints = { @@ -4089,9 +4087,6 @@ var Endpoints = { "GET /repos/{owner}/{repo}/actions/permissions/selected-actions" ], getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], - getCustomOidcSubClaimForRepo: [ - "GET /repos/{owner}/{repo}/actions/oidc/customization/sub" - ], getEnvironmentPublicKey: [ "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key" ], @@ -4244,9 +4239,6 @@ var Endpoints = { setCustomLabelsForSelfHostedRunnerForRepo: [ "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" ], - setCustomOidcSubClaimForRepo: [ - "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub" - ], setGithubActionsDefaultWorkflowPermissionsOrganization: [ "PUT /orgs/{org}/actions/permissions/workflow" ], @@ -4316,7 +4308,6 @@ var Endpoints = { listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], markNotificationsAsRead: ["PUT /notifications"], markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], - markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"], markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], setThreadSubscription: [ @@ -4593,10 +4584,10 @@ var Endpoints = { updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] }, copilot: { - addCopilotSeatsForTeams: [ + addCopilotForBusinessSeatsForTeams: [ "POST /orgs/{org}/copilot/billing/selected_teams" ], - addCopilotSeatsForUsers: [ + addCopilotForBusinessSeatsForUsers: [ "POST /orgs/{org}/copilot/billing/selected_users" ], cancelCopilotSeatAssignmentForTeams: [ @@ -4909,24 +4900,10 @@ var Endpoints = { } ] }, - oidc: { - getOidcCustomSubTemplateForOrg: [ - "GET /orgs/{org}/actions/oidc/customization/sub" - ], - updateOidcCustomSubTemplateForOrg: [ - "PUT /orgs/{org}/actions/oidc/customization/sub" - ] - }, orgs: { addSecurityManagerTeam: [ "PUT /orgs/{org}/security-managers/teams/{team_slug}" ], - assignTeamToOrgRole: [ - "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" - ], - assignUserToOrgRole: [ - "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}" - ], blockUser: ["PUT /orgs/{org}/blocks/{username}"], cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], @@ -4935,7 +4912,6 @@ var Endpoints = { convertMemberToOutsideCollaborator: [ "PUT /orgs/{org}/outside_collaborators/{username}" ], - createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"], createInvitation: ["POST /orgs/{org}/invitations"], createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"], createOrUpdateCustomPropertiesValuesForRepos: [ @@ -4946,9 +4922,6 @@ var Endpoints = { ], createWebhook: ["POST /orgs/{org}/hooks"], delete: ["DELETE /orgs/{org}"], - deleteCustomOrganizationRole: [ - "DELETE /orgs/{org}/organization-roles/{role_id}" - ], deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], enableOrDisableSecurityProductOnAllOrgRepos: [ "POST /orgs/{org}/{security_product}/{enablement}" @@ -4960,7 +4933,6 @@ var Endpoints = { ], getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], - getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"], getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], getWebhookDelivery: [ @@ -4976,12 +4948,6 @@ var Endpoints = { listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], listMembers: ["GET /orgs/{org}/members"], listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], - listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"], - listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"], - listOrgRoles: ["GET /orgs/{org}/organization-roles"], - listOrganizationFineGrainedPermissions: [ - "GET /orgs/{org}/organization-fine-grained-permissions" - ], listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], listPatGrantRepositories: [ "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories" @@ -4996,9 +4962,6 @@ var Endpoints = { listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"], listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], listWebhooks: ["GET /orgs/{org}/hooks"], - patchCustomOrganizationRole: [ - "PATCH /orgs/{org}/organization-roles/{role_id}" - ], pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], redeliverWebhookDelivery: [ "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" @@ -5023,18 +4986,6 @@ var Endpoints = { reviewPatGrantRequestsInBulk: [ "POST /orgs/{org}/personal-access-token-requests" ], - revokeAllOrgRolesTeam: [ - "DELETE /orgs/{org}/organization-roles/teams/{team_slug}" - ], - revokeAllOrgRolesUser: [ - "DELETE /orgs/{org}/organization-roles/users/{username}" - ], - revokeOrgRoleTeam: [ - "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" - ], - revokeOrgRoleUser: [ - "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}" - ], setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], setPublicMembershipForAuthenticatedUser: [ "PUT /orgs/{org}/public_members/{username}" @@ -5325,9 +5276,6 @@ var Endpoints = { {}, { mapToData: "users" } ], - cancelPagesDeployment: [ - "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel" - ], checkAutomatedSecurityFixes: [ "GET /repos/{owner}/{repo}/automated-security-fixes" ], @@ -5363,15 +5311,12 @@ var Endpoints = { createForAuthenticatedUser: ["POST /user/repos"], createFork: ["POST /repos/{owner}/{repo}/forks"], createInOrg: ["POST /orgs/{org}/repos"], - createOrUpdateCustomPropertiesValues: [ - "PATCH /repos/{owner}/{repo}/properties/values" - ], createOrUpdateEnvironment: [ "PUT /repos/{owner}/{repo}/environments/{environment_name}" ], createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], createOrgRuleset: ["POST /orgs/{org}/rulesets"], - createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"], + createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployment"], createPagesSite: ["POST /repos/{owner}/{repo}/pages"], createRelease: ["POST /repos/{owner}/{repo}/releases"], createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"], @@ -5524,9 +5469,6 @@ var Endpoints = { getOrgRulesets: ["GET /orgs/{org}/rulesets"], getPages: ["GET /repos/{owner}/{repo}/pages"], getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], - getPagesDeployment: [ - "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}" - ], getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], getPullRequestReviewProtection: [ @@ -5737,9 +5679,6 @@ var Endpoints = { ] }, securityAdvisories: { - createFork: [ - "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks" - ], createPrivateVulnerabilityReport: [ "POST /repos/{owner}/{repo}/security-advisories/reports" ], @@ -38911,7 +38850,13 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms)); return match === "\n" ? "\\n" : "\\r\\n"; }); - console.log("inputs", { repo, branch, prompt }); + const personalAccessToken = process.env.IS_DEV + ? "" + : process.env.PERSONAL_GH_TOKEN; + + let os = process.env.IS_DEV ? "mac" : config.input.os; + + console.log("inputs", { repo, branch, prompt, os }); console.log('TestDriver: "Dispatching testdriver..."'.green); @@ -38923,6 +38868,7 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms)); repo, branch, prompt, + personalAccessToken, }, { Accept: "application/json", diff --git a/src/index.js b/src/index.js index 088052c..bd8d378 100644 --- a/src/index.js +++ b/src/index.js @@ -38,7 +38,13 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms)); return match === "\n" ? "\\n" : "\\r\\n"; }); - console.log("inputs", { repo, branch, prompt }); + const personalAccessToken = process.env.IS_DEV + ? "" + : process.env.PERSONAL_GH_TOKEN; + + let os = process.env.IS_DEV ? "mac" : config.input.os; + + console.log("inputs", { repo, branch, prompt, os }); console.log('TestDriver: "Dispatching testdriver..."'.green); @@ -50,6 +56,7 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms)); repo, branch, prompt, + personalAccessToken, }, { Accept: "application/json", From 6aee627bed7d5c0c652a1d0b11f648720a98acd8 Mon Sep 17 00:00:00 2001 From: tpikachu <46133358+tpikachu@users.noreply.github.com> Date: Wed, 20 Mar 2024 09:59:03 -0500 Subject: [PATCH 2/2] fix some issues --- .github/workflows/pr.yml | 2 +- dist/index.js | 4 +--- src/index.js | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 14325dc..953d593 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -17,4 +17,4 @@ jobs: 2. find a cat video 3. quit the browser env: - PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + PERSONAL_GH_TOKEN: ${{ secrets.PERSONAL_GH_TOKEN }} diff --git a/dist/index.js b/dist/index.js index 6214af0..5039f26 100644 --- a/dist/index.js +++ b/dist/index.js @@ -38854,9 +38854,7 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms)); ? "" : process.env.PERSONAL_GH_TOKEN; - let os = process.env.IS_DEV ? "mac" : config.input.os; - - console.log("inputs", { repo, branch, prompt, os }); + console.log("inputs", { repo, branch, prompt }); console.log('TestDriver: "Dispatching testdriver..."'.green); diff --git a/src/index.js b/src/index.js index bd8d378..f9f5b3e 100644 --- a/src/index.js +++ b/src/index.js @@ -42,9 +42,7 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms)); ? "" : process.env.PERSONAL_GH_TOKEN; - let os = process.env.IS_DEV ? "mac" : config.input.os; - - console.log("inputs", { repo, branch, prompt, os }); + console.log("inputs", { repo, branch, prompt }); console.log('TestDriver: "Dispatching testdriver..."'.green);