https://github.com/botify-labs/profilecli-action
https://github.com/botify-labs/profilecli-action
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/botify-labs/profilecli-action
- Owner: botify-labs
- Created: 2025-03-05T15:59:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-02T06:46:12.000Z (12 months ago)
- Last Synced: 2025-07-02T07:42:06.663Z (12 months ago)
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# profilecli-action
A GitHub Action to download and commit a PGO profile using
[profilecli](https://grafana.com/docs/pyroscope/latest/view-and-analyze-profile-data/profile-cli/).
## Prerequisites
- On your repository, go to Settings > Actions > General and check
`Allow GitHub Actions to create and approve pull requests`
- `GH_TOKEN` must be set in your workflow environment:
```yaml
env:
GH_TOKEN: ${{ github.token }}
```
## Usage example
```yaml
name: Profiling
on:
schedule:
- cron: "0 8 * * 1" # every Monday at 08:00am
env:
GH_TOKEN: ${{ github.token }} # required
permissions:
contents: write
pull-requests: write
jobs:
profiling:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download profile
uses: botify-labs/profilecli-action@v1
with:
endpoint: https://example.com/my-endpoint
username: ${{ secrets.PROFILING_USERNAME }}
password: ${{ secrets.PROFILING_PASSWORD }}
query: '{service_name=""}'
output_path: default.pgo
range_from: now-24h
range_to: now
```
## Parameters
| Name | Default value | Description |
| -------------------- | ------------------------------------------- | ------------------------------------------------------- |
| `endpoint`\* | - | API endpoint to fetch profiling data. |
| `query`\* | - | Query used to filter profiling data. |
| `username`\* | - | Username for authentication. |
| `password`\* | - | Password for authentication. |
| `output_path` | `default.pgo` | File path to save the profile output. |
| `range_from` | `now-24h` | Start time for the profiling range. |
| `range_to` | `now` | End time for the profiling range. |
| `profile_type` | `process_cpu:samples:count:cpu:nanoseconds` | Type of profile to fetch and analyze. |
| `profilecli_version` | `"1.1.5"` | Version of profilecli to use. |
| `pr_title` | `"Generate Go profile"` | Title for the pull request that will be created. |
| `pr_body` | `"Autogenerated profile update."` | Body content for the pull request that will be created. |