Skip to content

Commit cc528ae

Browse files
eullerborgesspl
authored andcommitted
Removing PERSONAL_GITHUB_TOKEN info
- This patch removes the now unnecessary use of PERSONAL_GITHUB_TOKEN after the fix for the bug in GitHub. - Reference: https://github.community/t/github-action-not-triggering-gh-pages-upon-push/16096/24 - Source: benchmark-action/github-action-benchmark#49
1 parent f4a4957 commit cc528ae

File tree

11 files changed

+18
-55
lines changed

11 files changed

+18
-55
lines changed

.github/workflows/benchmarkdotnet.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ jobs:
2121
name: Benchmark.Net Benchmark
2222
tool: 'benchmarkdotnet'
2323
output-file-path: examples/benchmarkdotnet/BenchmarkDotNet.Artifacts/results/Sample.Benchmarks-report-full-compressed.json
24-
# Use personal access token instead of GITHUB_TOKEN due to https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869/highlight/false
25-
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
24+
github-token: ${{ secrets.GITHUB_TOKEN }}
2625
auto-push: true
2726
# Show alert with commit comment on detecting possible performance regression
2827
alert-threshold: '200%'

.github/workflows/benchmarkjs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ jobs:
1919
name: Benchmark.js Benchmark
2020
tool: 'benchmarkjs'
2121
output-file-path: examples/benchmarkjs/output.txt
22-
# Use personal access token instead of GITHUB_TOKEN due to https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869/highlight/false
23-
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
22+
github-token: ${{ secrets.GITHUB_TOKEN }}
2423
auto-push: true
2524
# Show alert with commit comment on detecting possible performance regression
2625
alert-threshold: '200%'

.github/workflows/catch2.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ jobs:
2323
name: Catch2 Benchmark
2424
tool: "catch2"
2525
output-file-path: examples/catch2/benchmark_result.txt
26-
# Use personal access token instead of GITHUB_TOKEN due to https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869/highlight/false
27-
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
26+
github-token: ${{ secrets.GITHUB_TOKEN }}
2827
auto-push: true
2928
# Show alert with commit comment on detecting possible performance regression
3029
alert-threshold: "200%"

.github/workflows/cpp.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ jobs:
2323
name: C++ Benchmark
2424
tool: 'googlecpp'
2525
output-file-path: examples/cpp/benchmark_result.json
26-
# Use personal access token instead of GITHUB_TOKEN due to https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869/highlight/false
27-
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
26+
github-token: ${{ secrets.GITHUB_TOKEN }}
2827
auto-push: true
2928
# Show alert with commit comment on detecting possible performance regression
3029
alert-threshold: '200%'

.github/workflows/criterion-rs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ jobs:
1919
name: Rust Benchmark
2020
tool: 'cargo'
2121
output-file-path: examples/criterion-rs/output.txt
22-
# Use personal access token instead of GITHUB_TOKEN due to https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869/highlight/false
23-
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
22+
github-token: ${{ secrets.GITHUB_TOKEN }}
2423
auto-push: true
2524
# Show alert with commit comment on detecting possible performance regression
2625
alert-threshold: '200%'

.github/workflows/go.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ jobs:
1919
name: Go Benchmark
2020
tool: 'go'
2121
output-file-path: examples/go/output.txt
22-
# Use personal access token instead of GITHUB_TOKEN due to https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869/highlight/false
23-
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
22+
github-token: ${{ secrets.GITHUB_TOKEN }}
2423
auto-push: true
2524
# Show alert with commit comment on detecting possible performance regression
2625
alert-threshold: '200%'

.github/workflows/pytest.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ jobs:
2222
name: Python Benchmark with pytest-benchmark
2323
tool: 'pytest'
2424
output-file-path: examples/pytest/output.json
25-
# Use personal access token instead of GITHUB_TOKEN due to https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869/highlight/false
26-
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
25+
github-token: ${{ secrets.GITHUB_TOKEN }}
2726
auto-push: true
2827
# Show alert with commit comment on detecting possible performance regression
2928
alert-threshold: '200%'

.github/workflows/rust.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ jobs:
1919
name: Rust Benchmark
2020
tool: 'cargo'
2121
output-file-path: examples/rust/output.txt
22-
# Use personal access token instead of GITHUB_TOKEN due to https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869/highlight/false
23-
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
22+
github-token: ${{ secrets.GITHUB_TOKEN }}
2423
auto-push: true
2524
# Show alert with commit comment on detecting possible performance regression
2625
alert-threshold: '200%'

CHANGELOG.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,10 @@ e.g.
249249
name: My Project Go Benchmark
250250
tool: 'go'
251251
output-file-path: output.txt
252-
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
252+
github-token: ${{ secrets.GITHUB_TOKEN }}
253253
auto-push: true
254254
```
255255
256-
Note that you need to make a personal access token for deploying GitHub Pages from GitHub Action workflow. Please read `RADME.md` for more details.
257-
258256
[Changes][v1.1.0]
259257
260258

README.md

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ In addition to the above setup, GitHub API token needs to be given to enable `co
191191
192192
`secrets.GITHUB_TOKEN` is [a GitHub API token automatically generated for each workflow run][help-github-token].
193193
It is necessary to send a commit comment when the benchmark result of the commit is detected as possible
194-
performance regression.
194+
performance regression and also to update the dashboard on GitHub Pages.
195195

196196
Now, in addition to making workflow fail, the step leaves a commit comment when it detects performance
197197
regression [like this][alert-comment-example]. Though `alert-comment-cc-users` input is not mandatory for
@@ -207,9 +207,7 @@ can be seen [here][commit-comment-workflow-example].
207207
It is useful to see how the benchmark results changed on each change in time-series charts. This action
208208
provides a chart dashboard on GitHub pages.
209209

210-
It requires some preparations before the workflow setup.
211-
212-
At first, you need to create a branch for GitHub Pages if you haven't created it yet.
210+
Before the workflow setup, you need to create a branch for GitHub Pages if you haven't yet done so.
213211

214212
```sh
215213
# Create a local branch
@@ -218,24 +216,7 @@ $ git checkout --orphan gh-pages
218216
$ git push origin gh-pages:gh-pages
219217
```
220218

221-
Second, you need to [create a personal access token][help-personal-access-token]. As of now,
222-
[deploying a GitHub Pages branch fails with `$GITHUB_TOKEN` automatically generated for workflows](https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869).
223-
`$GITHUB_TOKEN` can push a branch to remote, but building GitHub Pages fails. Please read
224-
[issue #1](https://github.com/rhysd/github-action-benchmark/issues/1) for more details.
225-
This is a current limitation only for public repositories. For private repository, `secrets.GITHUB_TOKEN`
226-
is available. In the future, this issue would be resolved and we could simply use `$GITHUB_TOKEN` to
227-
deploy a GitHub Pages branch.
228-
229-
1. Go to your user settings page
230-
2. Enter 'Developer settings' tab
231-
3. Enter 'Personal access tokens' tab
232-
4. Click 'Generate new token' and enter your favorite token name
233-
5. Check `repo` scope for `git push` and click 'Generate token' at bottom
234-
6. Go to your repository settings page
235-
7. Enter 'Secrets' tab
236-
8. Create new `PERSONAL_GITHUB_TOKEN` secret with a generated token string
237-
238-
Now you're ready for workflow setup.
219+
Now, for the workflow setup.
239220

240221
```yaml
241222
jobs:
@@ -255,8 +236,7 @@ jobs:
255236
name: My Project Go Benchmark
256237
tool: 'go'
257238
output-file-path: output.txt
258-
# Personal access token to deploy GitHub Pages branch
259-
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
239+
github-token: ${{ secrets.GITHUB_TOKEN }}
260240
# Push and deploy GitHub pages branch automatically
261241
auto-push: true
262242
```
@@ -284,8 +264,6 @@ benchmark results identical.
284264

285265
Please see the above ['Examples' section](#examples) to see live workflow examples for each language.
286266

287-
If you don't want to pass GitHub API token to this action, it's still OK.
288-
289267
```yaml
290268
- name: Store benchmark result
291269
uses: rhysd/github-action-benchmark@v1
@@ -297,7 +275,7 @@ If you don't want to pass GitHub API token to this action, it's still OK.
297275
auto-push: false
298276
# Push gh-pages branch by yourself
299277
- name: Push benchmark result
300-
run: git push 'https://you:${{ secrets.PERSONAL_GITHUB_TOKEN }}@github.com/you/repo-name.git' gh-pages:gh-pages
278+
run: git push gh-pages:gh-pages
301279
```
302280

303281
Please add a step to push the branch to the remote.
@@ -369,8 +347,7 @@ The path can be relative to repository root.
369347
- Type: String
370348
- Default: N/A
371349

372-
GitHub API token. For updating a GitHub Pages branch with public repo, a personal access token is necessary.
373-
Please see the 'Commit comment' section for more details.
350+
GitHub API token. Note that `secrets.GITHUB_TOKEN` works by default for updating a GitHub Pages branch with either public or private repositories.
374351

375352
#### `auto-push` (Optional)
376353

@@ -386,8 +363,7 @@ Otherwise, you need to push it by your own. Please read 'Commit comment' section
386363
- Default: `false`
387364

388365
If it is set to `true`, this action will leave a commit comment comparing the current benchmark with previous.
389-
`github-token` is necessary as well. Please note that a personal access token is not necessary to
390-
send a commit comment. `secrets.GITHUB_TOKEN` is sufficient.
366+
`github-token` is necessary as well.
391367

392368
#### `save-data-file` (Optional)
393369

@@ -414,9 +390,7 @@ See `comment-on-alert` and `fail-on-alert` also.
414390
- Default: `false`
415391

416392
If it is set to `true`, this action will leave a commit comment when an alert happens [like this][alert-comment-example].
417-
`github-token` is necessary as well. Please note that a personal access token is not necessary to
418-
send a commit comment. `secrets.GITHUB_TOKEN` is sufficient. For the threshold for this, please see
419-
`alert-threshold` also.
393+
`github-token` is necessary as well. For the threshold for this, please see `alert-threshold` also.
420394

421395
#### `fail-on-alert` (Optional)
422396

@@ -595,7 +569,6 @@ will appear on your GitHub notifications page.
595569
[catch2-workflow-example]: https://github.com/rhysd/github-action-benchmark/actions?query=workflow%3A%22Catch2+C%2B%2B+Example%22
596570
[help-watch-release]: https://help.github.com/en/github/receiving-notifications-about-activity-on-github/watching-and-unwatching-releases-for-a-repository
597571
[help-github-token]: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token
598-
[help-personal-access-token]: https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line
599572
[minimal-workflow-example]: https://github.com/rhysd/github-action-benchmark/actions?query=workflow%3A%22Example+for+minimal+setup
600573
[commit-comment-workflow-example]: https://github.com/rhysd/github-action-benchmark/actions?query=workflow%3A%22Example+for+alert+with+commit+comment
601574
[google-benchmark]: https://github.com/google/benchmark

0 commit comments

Comments
 (0)