From 4acdcd5270056064ebfc5051c6a21868695b0710 Mon Sep 17 00:00:00 2001 From: Keyrxng <106303466+Keyrxng@users.noreply.github.com> Date: Tue, 27 Feb 2024 21:10:44 +0000 Subject: [PATCH] chore: no secret access dont throw err on no config --- src/action.yml | 4 +--- src/utils/helpers.ts | 14 +++++--------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/action.yml b/src/action.yml index 4460986..b7b7d3d 100644 --- a/src/action.yml +++ b/src/action.yml @@ -21,6 +21,4 @@ runs: steps: - name: Exec Research Command run: npx tsx src/index.ts "${{ inputs.body }}" ${{ inputs.issueNumber }} ${{ inputs.sender }} ${{ inputs.repo }} ${{ inputs.org }} - shell: bash - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash \ No newline at end of file diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index a16f1aa..593dabf 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -30,15 +30,11 @@ export async function getUbiquiBotConfig(octokit: Octokit, owner: string, repo: } async function fetchConfig(octokit: Octokit, owner: string, repo: string): Promise { - const response = await octokit.rest.repos - .getContent({ - owner, - repo, - path: ".github/ubiquibot-config.yml", - }) - .catch((error) => { - throw new Error(`Error fetching config: ${error}`); - }); + const response = await octokit.rest.repos.getContent({ + owner, + repo, + path: ".github/ubiquibot-config.yml", + }); // Check if the response data is a file and has a content property if ("content" in response.data && typeof response.data.content === "string") {