Skip to content

Commit

Permalink
enhancement: Set user-agent while sending requests to GitHub API (#47)
Browse files Browse the repository at this point in the history
Signed-off-by: Oğuzhan Durgun <oguzhandurgun95@gmail.com>
  • Loading branch information
oguzhand95 committed Feb 17, 2023
1 parent 41ae5ab commit c656f29
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion src/get-url-to-download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ async function getURLToDownload(
githubToken: string
): Promise<string> {
const assetName = `cerbos_${version}_${runningEnvironment.os}_${runningEnvironment.architecture}.tar.gz`
const octokit = new Octokit({auth: githubToken})
const octokit = new Octokit({
auth: githubToken,
userAgent: process.env['GITHUB_REPOSITORY']
? process.env['GITHUB_REPOSITORY']
: 'cerbos-setup-action'
})
const {data: releases} = await octokit.request(
'GET /repos/{owner}/{repo}/releases',
{
Expand Down

0 comments on commit c656f29

Please sign in to comment.