Skip to content

Commit

Permalink
chore: no secret access dont throw err on no config
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Feb 27, 2024
1 parent 397566c commit 4acdcd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
4 changes: 1 addition & 3 deletions src/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 5 additions & 9 deletions src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ export async function getUbiquiBotConfig(octokit: Octokit, owner: string, repo:
}

async function fetchConfig(octokit: Octokit, owner: string, repo: string): Promise<UbiquiBotConfig | null> {
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") {
Expand Down

0 comments on commit 4acdcd5

Please sign in to comment.