Skip to content

Commit

Permalink
Add uploadExtraArgs support
Browse files Browse the repository at this point in the history
  • Loading branch information
Djiit authored and alekseykulikov committed Feb 4, 2024
1 parent 7f5e1fd commit e4e4dc8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,14 @@ Upload Lighthouse results as [action artifacts](https://help.github.com/en/actio
uploadArtifacts: true
```

#### `uploadExtraArgs`

Add extra args to the [upload command](https://github.com/GoogleChrome/lighthouse-ci/blob/main/docs/configuration.md#upload).

```yml
uploadExtraArgs: "--extraHeaders.Authorization='Bearer X92sEo3n1J1F0k1E9' --extraHeaders.Foo='Bar'"
```

#### `temporaryPublicStorage` (default: false)

Upload reports to the [_temporary public storage_](https://github.com/GoogleChrome/lighthouse-ci/blob/master/docs/getting-started.md#collect-lighthouse-results).
Expand Down
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ inputs:
description: 'Basic auth username for LHCI server'
basicAuthPassword:
description: 'Basic auth password for LHCI server'
uploadExtraArgs:
description: 'Upload command extra arguments'
outputs:
resultsPath:
description: 'Path to the folder with LHCI results'
Expand Down
1 change: 1 addition & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ exports.getInput = function getInputArgs() {
serverToken,
temporaryPublicStorage,
uploadArtifacts: core.getInput('uploadArtifacts') === 'true' ? true : false,
uploadExtraArgs: core.getInput('uploadExtraArgs') || '',
basicAuthUsername: core.getInput('basicAuthUsername') || 'lighthouse',
basicAuthPassword: core.getInput('basicAuthPassword'),
artifactName: core.getInput('artifactName'),
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ async function main() {

if (input.configPath) uploadParams.push(`--config=${input.configPath}`)

if (input.uploadExtraArgs) uploadParams.push(input.uploadExtraArgs)

const uploadStatus = runChildCommand('upload', uploadParams)
if (uploadStatus !== 0) throw new Error(`LHCI 'upload' failed to upload to LHCI server.`)
}
Expand Down

0 comments on commit e4e4dc8

Please sign in to comment.