{"id":7747377,"name":"StartAutomating/Benchpress","ecosystem":"actions","description":"Easy Benchmarking with PowerShell","homepage":"https://benchpress.start-automating.com","licenses":"mit","normalized_licenses":["MIT"],"repository_url":"https://github.com/StartAutomating/Benchpress","keywords_array":["benchmark","benchmarking","performance-testing","powershell"],"namespace":"StartAutomating","versions_count":10,"first_release_published_at":"2021-02-21T23:57:59.000Z","latest_release_published_at":"2023-07-08T23:01:09.000Z","latest_release_number":"v1.3.8","last_synced_at":"2026-03-24T05:21:08.602Z","created_at":"2023-05-17T11:23:36.323Z","updated_at":"2026-03-24T05:21:08.603Z","registry_url":"https://github.com/StartAutomating/Benchpress","install_command":null,"documentation_url":null,"metadata":{"name":"Benchmark with Benchpress","description":"Easy Benchmarking with PowerShell","inputs":{"BenchmarkPath":{"required":false,"description":"The path to the benchmark file.  \nIf not provided, any benchmark files in your repository will be used\n"},"ModulePath":{"required":false,"description":"The path to the module."},"OutputPath":{"required":false,"default":"docs","description":"The output path for the benchmark files.  By default \"docs\""},"CommitMessage":{"required":false,"description":"If provided, will commit any remaining changes made to the workspace with this commit message.\nIf no commit message is provided, changes will not be committed.\n"},"UserEmail":{"required":false,"description":"The user email associated with a git commit."},"UserName":{"required":false,"description":"The user name associated with a git commit."}},"branding":{"icon":"watch","color":"blue"},"runs":{"using":"composite","steps":[{"name":"Benchpress","id":"Benchpress","shell":"pwsh","env":{"UserEmail":"${{inputs.UserEmail}}","CommitMessage":"${{inputs.CommitMessage}}","UserName":"${{inputs.UserName}}","OutputPath":"${{inputs.OutputPath}}","ModulePath":"${{inputs.ModulePath}}","BenchmarkPath":"${{inputs.BenchmarkPath}}"},"run":"$Parameters = @{}\n$Parameters.BenchmarkPath = ${env:BenchmarkPath}\n$Parameters.BenchmarkPath = $parameters.BenchmarkPath -split ';' -replace '^[''\"]' -replace  '[''\"]$'\n$Parameters.ModulePath = ${env:ModulePath}\n$Parameters.OutputPath = ${env:OutputPath}\n$Parameters.CommitMessage = ${env:CommitMessage}\n$Parameters.UserEmail = ${env:UserEmail}\n$Parameters.UserName = ${env:UserName}\nforeach ($k in @($parameters.Keys)) {\n    if ([String]::IsNullOrEmpty($parameters[$k])) {\n        $parameters.Remove($k)\n    }\n}\nWrite-Host \"::debug:: Benchpress $(@(foreach ($p in $Parameters.GetEnumerator()) {'-' + $p.Key + ' ' + $p.Value}) -join ' ')\"\n\u0026 {\u003c#\n.Synopsis\n    Benchpress Action\n.Description\n    Runs Benchmarks on your code.\n#\u003e\nparam(\n# The path to the benchmark file.  \n# If not provided, any benchmark files in your repository will be used\n[string[]]\n$BenchmarkPath,\n\n# The path to the module.\n[string]\n$ModulePath,\n\n# The output path for the benchmark files.  By default \"docs\"\n[string]\n$OutputPath = \"docs\",\n\n# If provided, will commit any remaining changes made to the workspace with this commit message.\n# If no commit message is provided, changes will not be committed.\n[string]\n$CommitMessage,\n\n# The user email associated with a git commit.\n[string]\n$UserEmail,\n\n# The user name associated with a git commit.\n[string]\n$UserName\n)\n\n\"::group::Parameters\" | Out-Host\n[PSCustomObject]$PSBoundParameters | Format-List | Out-Host\n\"::endgroup::\" | Out-Host\n\n\n$gitHubEvent = if ($env:GITHUB_EVENT_PATH) {\n    [IO.File]::ReadAllText($env:GITHUB_EVENT_PATH) | ConvertFrom-Json\n} else { $null }\n\n@\"\n::group::GitHubEvent\n$($gitHubEvent | ConvertTo-Json -Depth 100)\n::endgroup::\n\"@ | Out-Host\n\n# Check to ensure we are on a branch\n$branchName = git rev-parse --abrev-ref HEAD\n# If we were not, return.\nif (-not $branchName) {\n    \"::warning::Not on a branch\" | Out-Host\n    return\n}\n\n$anyFilesChanged = $false\n$processScriptOutput = { process { \n    $out = $_\n    $outItem = Get-Item -Path $out -ErrorAction SilentlyContinue\n    $fullName, $shouldCommit = \n        if ($out -is [IO.FileInfo]) {\n            $out.FullName, (git status $out.Fullname -s)\n        } elseif ($outItem) {\n            $outItem.FullName, (git status $outItem.Fullname -s)\n        }\n    if ($shouldCommit) {\n        git add $fullName\n        if ($out.Message) {\n            git commit -m \"$($out.Message)\"\n        } elseif ($out.CommitMessage) {\n            git commit -m \"$($out.CommitMessage)\"\n        }  elseif ($gitHubEvent.head_commit.message) {\n            git commit -m \"$($gitHubEvent.head_commit.message)\"\n        }  \n        $anyFilesChanged = $true\n    }\n    $out\n} }\n\nif (-not $UserName)  {\n    $UserName =  \n        if ($env:GITHUB_TOKEN) {\n            Invoke-RestMethod -uri \"https://api.github.com/user\" -Headers @{\n                Authorization = \"token $env:GITHUB_TOKEN\"\n            } |\n                Select-Object -First 1 -ExpandProperty name\n        } else {\n            $env:GITHUB_ACTOR\n        }\n}\n\nif (-not $UserEmail) { \n    $GitHubUserEmail = \n        if ($env:GITHUB_TOKEN) {\n            Invoke-RestMethod -uri \"https://api.github.com/user/emails\" -Headers @{\n                Authorization = \"token $env:GITHUB_TOKEN\"\n            } |\n                Select-Object -First 1 -ExpandProperty email\n        } else {''}\n    $UserEmail = \n        if ($GitHubUserEmail) {\n            $GitHubUserEmail\n        } else {\n            \"$UserName@github.com\"\n        }    \n}\ngit config --global user.email $UserEmail\ngit config --global user.name  $UserName\n\nif (-not $BenchmarkPath) {\n    $BenchmarkPath = \n        Get-ChildItem \"$env:GITHUB_WORKSPACE\" -Recurse | \n        Where-Object Name -Like '*.benchmark.*' | \n        Split-Path | \n        Select-Object -Unique\n}\n\n\"::warning::Benchmark Path - $($BenchmarkPath | Out-String)\"\n\n$PSD1Found = Get-ChildItem -Recurse -Filter \"*.psd1\" |\n    Where-Object Name -eq 'Benchpress.psd1' | \n    Select-Object -First 1\n\nif ($PSD1Found) {\n    $BenchpressPath = $PSD1Found\n    Import-Module $PSD1Found -Force -PassThru | Out-Host\n} elseif ($env:GITHUB_ACTION_PATH) {\n    $benchPressPath = Join-Path $env:GITHUB_ACTION_PATH 'Benchpress.psd1'\n    if (Test-path $benchPressPath) {\n        Import-Module $benchPressPath -Force -PassThru | Out-String\n    } else {\n        throw \"Benchmark not found\"\n    }\n} else {\n    dir env: | Out-String\n    throw \"Action Path not found\"\n}\n\n\"::notice title=ModuleLoaded::Benchpress Loaded from Path - $($BenchpressPath)\" | Out-Host\n\nif (-not $ModulePath) {\n    Get-ChildItem -ErrorAction SilentlyContinue -Path $BenchmarkPath -Filter *.psd1\n} elseif (-not (Test-Path $ModulePath) -and $env:GITHUB_WORKSPACE) {\n    $ModulePath = Join-Path (Join-Path $env:GITHUB_WORKSPACE \"RepositoryToBenchmark\") $ModulePath\n}\n\nif ($modulePath -and (Test-Path $ModulePath -ErrorAction SilentlyContinue )) {\n    Import-Module $ModulePath -Force -PassThru | Out-String\n}\n\n$benchpressModule = Get-Module Benchpress\nif (-not $benchpressModule) { throw \"Benchpress not loaded\" }\n$startTime = [DateTime]::Now\n\nif (-not (Test-Path $OutputPath)) {\n    $createOutputPath = New-Item -ItemType Directory -Path $OutputPath    \n    if (-not $createOutputPath) {\n        throw \"Could not create -OutputPath $outputPath\"\n    }\n}\n\n$benchmarkOutputFiles = $BenchmarkPath | \n    Get-ChildItem -LiteralPath {$_ } -ErrorAction SilentlyContinue |\n    Where-Object Name -Like '*.benchmark.*' |\n    Where-Object Name -NotLike '*.benchmarkOutput.*' |\n    ForEach-Object { \n        \"::notice title=FoundBenchmarkFile::$($_.FullName)\" | Out-Host\n        $_        \n    } |\n    Checkpoint-Benchmark -OutputPath {\n        $fileInfo = $_\n        $fileName = $fileInfo.Name        \n        $fileNameMinusExtension = $fileName.Substring(0, $fileName.IndexOf($fileInfo.Extension))\n        \"$(Join-Path $OutputPath ($fileNameMinusExtension + '.benchmarkOutput.clixml'))\"\n    }\n\n$filesToCheckin =\n    foreach ($benchOutFile in $benchmarkOutputFiles) {\n        $newName = $benchOutFile.Fullname -replace '\\.clixml$', '.md'\n        Show-Benchmark -BenchmarkPath $benchOutFile.Fullname  |\n            Set-Content -Path $newName\n        \n        Get-Item $newName\n    }\n\n$filesToCheckin | \n    . $processScriptOutput |\n    Out-Host\n\n$benchmarkOutputFiles | \n    Import-Clixml |\n    Out-Host\n\ngit pull | Out-Host\n\n$endTime = [DateTime]::Now\n\"::set-output name=TotalDuration::$(($endTime - $startTime).TotalSeconds)\" | Out-Host\n\nif ($CommitMessage -or $anyFilesChanged) {\n    if ($CommitMessage) {\n        dir $env:GITHUB_WORKSPACE -Recurse |\n            ForEach-Object {\n                $gitStatusOutput = git status $_.Fullname -s\n                if ($gitStatusOutput) {\n                    git add $_.Fullname\n                }\n            }\n\n        git commit -m $ExecutionContext.SessionState.InvokeCommand.ExpandString($CommitMessage)\n    }    \n\n    $checkDetached = git symbolic-ref -q HEAD\n    if (-not $LASTEXITCODE) {\n        \"::notice::Pulling Changes\" | Out-Host\n        git pull | Out-Host\n        \"::notice::Pushing Changes\" | Out-Host\n        git push        \n        \"Git Push Output: $($gitPushed  | Out-String)\"\n    } else {\n        \"::notice::Not pushing changes (on detached head)\" | Out-Host\n        $LASTEXITCODE = 0\n        exit 0\n    }\n}\n\nreturn\n\n} @Parameters\n"}]},"default_branch":"master","path":null},"repo_metadata":{"uuid":"177236482","full_name":"StartAutomating/Benchpress","owner":"StartAutomating","description":"Easy Benchmarking with PowerShell","archived":false,"fork":false,"pushed_at":"2023-07-08T23:03:02.000Z","size":1253,"stargazers_count":45,"open_issues_count":0,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2023-07-09T00:19:03.258Z","etag":null,"topics":["benchmark","benchmarking","performance-testing","powershell"],"latest_commit_sha":null,"homepage":"https://benchpress.start-automating.com","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StartAutomating.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-23T02:51:14.000Z","updated_at":"2023-07-08T23:50:06.000Z","dependencies_parsed_at":"2023-02-12T23:31:44.081Z","dependency_job_id":null,"html_url":"https://github.com/StartAutomating/Benchpress","commit_stats":null,"previous_names":[],"tags_count":10,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StartAutomating","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":145725947,"owners_count":6280970,"icon_url":"https://github.com/github.png","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"},"owner_record":{"login":"StartAutomating","name":"James Brundage","uuid":"1043665","kind":"user","description":"","email":"","website":"http://start-automating.com/","location":"Seattle, WA","twitter":"jamesbru","company":"Start-Automating","icon_url":"https://avatars.githubusercontent.com/u/1043665?u=38888051372474754f0b622ada16d87ce69227ca\u0026v=4","repositories_count":39,"last_synced_at":"2023-02-24T13:57:29.796Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/StartAutomating","created_at":"2022-11-08T04:14:46.274Z","updated_at":"2023-02-24T13:57:29.798Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StartAutomating","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StartAutomating/repositories"},"tags":[{"name":"v1.3.8","sha":"1e934c3d1aecbefc4171c48f02ab1b7adb9a484a","kind":"tag","published_at":"2023-07-08T23:01:09.000Z","download_url":"https://codeload.github.com/StartAutomating/Benchpress/tar.gz/v1.3.8","html_url":"https://github.com/StartAutomating/Benchpress/releases/tag/v1.3.8","dependencies_parsed_at":"2023-07-10T04:05:22.857Z","dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3.8","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3.8/manifests"},{"name":"v1.3.7","sha":"70cbe1ac736db2fb91b86a5744e0b8472ab6d8b8","kind":"tag","published_at":"2023-01-21T22:46:24.000Z","download_url":"https://codeload.github.com/StartAutomating/Benchpress/tar.gz/v1.3.7","html_url":"https://github.com/StartAutomating/Benchpress/releases/tag/v1.3.7","dependencies_parsed_at":"2023-06-02T00:40:59.036Z","dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3.7","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3.7/manifests"},{"name":"v1.3.6","sha":"5dc858c3c350c9f9d4fa8d6cc3aa35810a741fe9","kind":"tag","published_at":"2022-11-03T00:27:35.000Z","download_url":"https://codeload.github.com/StartAutomating/Benchpress/tar.gz/v1.3.6","html_url":"https://github.com/StartAutomating/Benchpress/releases/tag/v1.3.6","dependencies_parsed_at":"2023-06-01T13:45:44.668Z","dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3.6","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3.6/manifests"},{"name":"v1.3.5","sha":"0ec8b74bdc3a092948f08b47825e15b51f362ce5","kind":"tag","published_at":"2022-08-30T04:52:16.000Z","download_url":"https://codeload.github.com/StartAutomating/Benchpress/tar.gz/v1.3.5","html_url":"https://github.com/StartAutomating/Benchpress/releases/tag/v1.3.5","dependencies_parsed_at":"2023-05-31T15:12:04.491Z","dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3.5","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3.5/manifests"},{"name":"v1.3.4","sha":"882ae45d9ae0a74f7be1125787f05db750fb97a5","kind":"tag","published_at":"2022-08-30T02:46:18.000Z","download_url":"https://codeload.github.com/StartAutomating/Benchpress/tar.gz/v1.3.4","html_url":"https://github.com/StartAutomating/Benchpress/releases/tag/v1.3.4","dependencies_parsed_at":"2023-05-31T15:12:04.841Z","dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3.4","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3.4/manifests"},{"name":"v1.3.3","sha":"fd0c9ac16b26a5f30d36ac81392b42910c0070ad","kind":"tag","published_at":"2022-08-30T02:33:18.000Z","download_url":"https://codeload.github.com/StartAutomating/Benchpress/tar.gz/v1.3.3","html_url":"https://github.com/StartAutomating/Benchpress/releases/tag/v1.3.3","dependencies_parsed_at":"2023-05-31T15:12:05.142Z","dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3.3","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3.3/manifests"},{"name":"v1.3.2","sha":"05584c0d0edb0f3eef0964320619b78f371610b0","kind":"tag","published_at":"2022-07-11T19:57:50.000Z","download_url":"https://codeload.github.com/StartAutomating/Benchpress/tar.gz/v1.3.2","html_url":"https://github.com/StartAutomating/Benchpress/releases/tag/v1.3.2","dependencies_parsed_at":"2023-05-31T15:12:05.443Z","dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3.2","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3.2/manifests"},{"name":"v1.3.1","sha":"a3c7fc27d843aa54fcfbf88440e1b3326bb6e448","kind":"tag","published_at":"2022-06-06T20:04:45.000Z","download_url":"https://codeload.github.com/StartAutomating/Benchpress/tar.gz/v1.3.1","html_url":"https://github.com/StartAutomating/Benchpress/releases/tag/v1.3.1","dependencies_parsed_at":"2023-05-31T15:12:05.710Z","dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3.1","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3.1/manifests"},{"name":"v1.3","sha":"8e3b289adf45addc6919bc9d0b58ec232b0af059","kind":"tag","published_at":"2021-11-08T02:14:07.000Z","download_url":"https://codeload.github.com/StartAutomating/Benchpress/tar.gz/v1.3","html_url":"https://github.com/StartAutomating/Benchpress/releases/tag/v1.3","dependencies_parsed_at":"2023-05-31T15:12:06.014Z","dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.3/manifests"},{"name":"v1.2","sha":"47198756457e20c81bf98d9ac2c76007ce2220c4","kind":"tag","published_at":"2021-02-21T23:57:59.000Z","download_url":"https://codeload.github.com/StartAutomating/Benchpress/tar.gz/v1.2","html_url":"https://github.com/StartAutomating/Benchpress/releases/tag/v1.2","dependencies_parsed_at":"2023-05-31T15:12:06.412Z","dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.2","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FBenchpress/tags/v1.2/manifests"}]},"repo_metadata_updated_at":"2023-07-14T10:28:07.506Z","dependent_packages_count":0,"downloads":null,"downloads_period":null,"dependent_repos_count":1,"rankings":{"downloads":null,"dependent_repos_count":24.73459039771827,"dependent_packages_count":0.0,"stargazers_count":3.8947868800507055,"forks_count":11.012517826018064,"docker_downloads_count":null,"average":9.91047377594676},"purl":"pkg:githubactions/StartAutomating/Benchpress","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/actions/StartAutomating/Benchpress","docker_dependents_count":null,"docker_downloads_count":null,"usage_url":"https://repos.ecosyste.ms/usage/actions/StartAutomating/Benchpress","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/actions/StartAutomating/Benchpress/dependencies","status":null,"funding_links":[],"critical":null,"issue_metadata":null,"versions_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/StartAutomating%2FBenchpress/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/StartAutomating%2FBenchpress/version_numbers","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/StartAutomating%2FBenchpress/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/StartAutomating%2FBenchpress/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/StartAutomating%2FBenchpress/codemeta","maintainers":[]}