Skip to content

Commit ad497b1

Browse files
committed
Fix absolute time selection URL
1 parent 2c26bd4 commit ad497b1

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Profiling data from one CI run looks [like this](https://pprof.me/475d1cc/).
1717
This action can automatically create GitHub deployments with links to your profiling data, making it easy to access the results directly from your GitHub repository. For this feature to work, the following parameters must be configured:
1818

1919
- `project_uuid`: Your Polar Signals Cloud project UUID
20+
- `github_token`: A GitHub token with the necessary permissions to create deployments to create the link to the profiling data on a Pull Request or commit.
2021

2122
If any of the required parameters are missing, the deployment creation will be skipped without failing the workflow, and log messages will indicate the reason.
2223

@@ -27,7 +28,6 @@ For the deployment creation to work, your workflow needs the following permissio
2728
```yaml
2829
permissions:
2930
deployments: write
30-
contents: read
3131
```
3232
3333
### Example Configuration
@@ -38,7 +38,6 @@ on: [push]
3838

3939
permissions:
4040
deployments: write
41-
contents: read
4241

4342
jobs:
4443
profile:
@@ -50,7 +49,8 @@ jobs:
5049
uses: polarsignals/gh-actions-ps-profiling@main
5150
with:
5251
polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_CLOUD_TOKEN }}
53-
project_uuid: 'your-project-uuid-here'
54-
labels: branch=${{ github.ref_name }};workflow=${{ github.workflow }};gh_run_id=${{ github.run_id }}
52+
project_uuid: 'your-project-uuid-here' # Don't use a secret for this, it's not sensitive, and otherwise the URL will be partially redacted.
53+
labels: ref_name=${{ github.ref_name }};workflow=${{ github.workflow }};gh_run_id=${{ github.run_id }}
54+
github_token: ${{ secrets.GITHUB_TOKEN }}
5555
```
5656

action.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ inputs:
3434
required: false
3535
default: 'cloud.polarsignals.com'
3636
github_token:
37-
description: 'GitHub token to use for creating deployments.'
37+
description: 'GitHub token to use for creating deployments for linking to Profiling data from pull requests.'
3838
required: false
39-
default: '${{ github.token }}'
4039
outputs:
4140
profiling_url:
4241
description: 'The URL to the profiling data in Polar Signals Cloud.'

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ async function post() {
172172
queryUrl += `&expression_a=${encodedExpression}`;
173173
queryUrl += `&from_a=${startTimestamp}`;
174174
queryUrl += `&to_a=${endTimestamp}`;
175-
queryUrl += `&time_selection_a=custom`;
175+
queryUrl += `&time_selection_a=absolute:${startTimestamp}-${endTimestamp}`;
176176
queryUrl += `&sum_by_a=comm`;
177177
queryUrl += `&merge_from_a=${startTimestamp}`;
178178
queryUrl += `&merge_to_a=${endTimestamp}`;

0 commit comments

Comments
 (0)