Skip to content

Commit

Permalink
Add option to specify a github-token to avoid rate-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
maginseb committed Feb 27, 2024
1 parent f17ad18 commit 3cfa655
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ inputs:
description: 'specify a version of the piper binary to use, may be "master", "latest" or a released tag'
required: false
default: 'latest'
github-token:
description: 'specify a token for access to github.com. This may be required when running on GitHub Enterprise to avoid rate-limits'
required: false
default: ''
runs:
using: 'node16'
main: 'dist/index.js'
branding:
icon: 'play'
icon: 'play'
color: 'green'
9 changes: 6 additions & 3 deletions src/piper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ async function run () {
const command = core.getInput('command')
const flags = core.getInput('flags')
const version = core.getInput('piper-version')

const auth = core.getInput('github-token')
// Download Piper
const piperBin = 'piper'
await new utils.GithubDownloaderBuilder('sap',
const downloader = new utils.GithubDownloaderBuilder('sap',
'jenkins-library',
piperBin,
version)
.githubEndpoint('https://github.com')
.download()
if (auth) {
downloader._auth = `Bearer ${auth}`
}
await downloader.download()

const directoryRestore = new utils.DirectoryRestore('.pipeline/commonPipelineEnvironment')
if (enableBetaFeatures) {
Expand Down

0 comments on commit 3cfa655

Please sign in to comment.