Skip to content

Commit b921fde

Browse files
committed
GitHub Actions permissions docs
Thank you, @dklassic and @wusyong #511 (comment)
1 parent fa0e897 commit b921fde

30 files changed

+308
-475
lines changed

services/console/src/chunks/docs-how-to/github-actions/base-branch-code.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
jobs:
77
benchmark_base_branch:
88
name: Continuous Benchmarking with Bencher
9+
permissions:
10+
checks: write
911
runs-on: ubuntu-latest
1012
steps:
1113
- uses: actions/checkout@v4

services/console/src/chunks/docs-how-to/github-actions/de/base-branch.mdx

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,35 @@ Diese historische Basislinie kann dann verwendet werden, um Leistungsregressione
1616
(z.B.: `on: push: branches: main`)
1717
3. Erstellen Sie einen `job` für GitHub Actions.
1818
(z.B.: `jobs: benchmark_base_branch`)
19-
4. Legen Sie den Maschinentyp fest, auf dem der Job ausgeführt wird.
19+
4. Setzen Sie [die Berechtigungen für das `GITHUB_TOKEN`][github token permissions]
20+
auf `write` für `checks`.
21+
(z.B.: `permissions: checks: write`)
22+
5. Legen Sie den Maschinentyp fest, auf dem der Job ausgeführt wird.
2023
Siehe die [GitHub Actions `runs-on` Dokumentation][github actions runs-on]
2124
für einen vollständigen Überblick.
2225
(z.B.: `runs-on: ubuntu-latest`)
23-
5. Checken Sie Ihren Basis-Branch Quellcode aus.
26+
6. Checken Sie Ihren Basis-Branch Quellcode aus.
2427
(z.B.: `uses: actions/checkout@v4`)
25-
6. Installieren Sie die Bencher CLI mithilfe der [GitHub Action][bencher cli github action].
28+
7. Installieren Sie die Bencher CLI mithilfe der [GitHub Action][bencher cli github action].
2629
(z.B.: `uses: bencherdev/bencher@main`)
27-
7. Verwenden Sie das <code><a href="/de/docs/explanation/bencher-run/">bencher run</a></code> CLI-Unterkommando,
30+
8. Verwenden Sie das <code><a href="/de/docs/explanation/bencher-run/">bencher run</a></code> CLI-Unterkommando,
2831
um Ihre `main`-Branch Benchmarks auszuführen.
2932
Siehe [das `bencher run` CLI-Unterkommando][bencher run] für einen vollständigen Überblick.
3033
(z.B.: `bencher run`)
31-
8. Setzen Sie die `--project` Option auf den Project-Slug.
34+
9. Setzen Sie die `--project` Option auf den Project-Slug.
3235
Siehe [die `--project` Doku][project option] für weitere Details.
3336
(z.B.: `--project save-walter-white-1234abcd`)
34-
9. Setzen Sie die `--token` Option auf das **Repository**-Geheimnis `BENCHER_API_TOKEN`.
37+
10. Setzen Sie die `--token` Option auf das **Repository**-Geheimnis `BENCHER_API_TOKEN`.
3538
Siehe [die `--token` Doku][token option] für weitere Details.
3639
(z.B.: `--token '${{ secrets.BENCHER_API_TOKEN }}'`)
37-
10. Setzen Sie die `--branch` Option auf den Basis-Branch Namen.
40+
11. Setzen Sie die `--branch` Option auf den Basis-Branch Namen.
3841
Siehe [die `--branch` Doku][branch option] für einen vollständigen Überblick.
3942
(z.B.: `--branch main`)
40-
11. Setzen Sie die `--testbed` Option auf den Testbed-Namen.
43+
12. Setzen Sie die `--testbed` Option auf den Testbed-Namen.
4144
Dies sollte wahrscheinlich mit der in `runs-on` ausgewählten Maschine übereinstimmen.
4245
Siehe [die `--testbed` Doku][testbed option] für weitere Details.
4346
(z.B.: `--testbed ubuntu-latest`)
44-
12. Setzen Sie den Threshold für den `main` Branch, `ubuntu-latest` Testbed und das `latency` Maß:
47+
13. Setzen Sie den Threshold für den `main` Branch, `ubuntu-latest` Testbed und das `latency` Maß:
4548
1. Setzen Sie die `--threshold-measure` Option auf das eingebaute `latency` Measure, das von <code><a href="/de/docs/reference/bencher-metric-format/#bencher-mock">bencher mock</a></code> generiert wird.
4649
Siehe [die `--threshold-measure` Doku][threshold measure option] für weitere Details.
4750
(z.B.: `--threshold-measure latency`)
@@ -57,25 +60,26 @@ Diese historische Basislinie kann dann verwendet werden, um Leistungsregressione
5760
5. Setzen Sie die `--thresholds-reset` Flag, damit nur der angegebene Threshold aktiv ist.
5861
Siehe [die `--thresholds-reset` Doku][thresholds reset] für einen vollständigen Überblick.
5962
(z.B.: `--thresholds-reset`)
60-
13. Setzen Sie die `--err` Flag, damit der Befehl fehlschlägt, wenn ein Alert generiert wird.
63+
14. Setzen Sie die `--err` Flag, damit der Befehl fehlschlägt, wenn ein Alert generiert wird.
6164
Siehe [die `--err` Doku][alert err] für einen vollständigen Überblick.
6265
(z.B.: `--err`)
63-
14. Setzen Sie die `--adapter` Option auf das [Bencher Metric Format JSON (`json`)][bmf], das von <code><a href="/de/docs/reference/bencher-metric-format/#bencher-mock">bencher mock</a></code> generiert wird.
66+
15. Setzen Sie die `--adapter` Option auf das [Bencher Metric Format JSON (`json`)][bmf], das von <code><a href="/de/docs/reference/bencher-metric-format/#bencher-mock">bencher mock</a></code> generiert wird.
6467
Siehe [benchmark harness adapters][adapter json] für einen vollständigen Überblick.
6568
(z.B.: `--adapter json`)
66-
15. Setzen Sie die `--github-actions` Option auf das GitHub API-Authentifizierungstoken, um Ergebnisse als GitHub Checks Kommentar zu posten, mithilfe
69+
16. Setzen Sie die `--github-actions` Option auf das GitHub API-Authentifizierungstoken, um Ergebnisse als GitHub Checks Kommentar zu posten, mithilfe
6770
der [GitHub Actions `GITHUB_TOKEN` Umgebungsvariable][github token].
6871
Siehe [die `--github-actions` Doku][github actions option] für weitere Details.
6972
(z.B.: `--github-actions '${{ secrets.GITHUB_TOKEN }}'`)
70-
16. Geben Sie die Argumente des Benchmark-Befehls an.
73+
17. Geben Sie die Argumente des Benchmark-Befehls an.
7174
Siehe [benchmark command][command argument] für einen vollständigen Überblick.
7275
(z.B.: `bencher mock`)
7376

74-
[github actions on]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
75-
[github actions push]: https://docs.github.com/en/webhooks/webhook-events-and-payloads#push
76-
[github actions runs-on]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
77+
[github actions on]: https://docs.github.com/de/actions/using-workflows/workflow-syntax-for-github-actions#on
78+
[github actions push]: https://docs.github.com/de/webhooks/webhook-events-and-payloads#push
79+
[github token permissions]: https://docs.github.com/de/actions/using-jobs/assigning-permissions-to-jobs#setting-the-github_token-permissions-for-a-specific-job
80+
[github actions runs-on]: https://docs.github.com/de/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
7781
[bencher cli github action]: https://github.com/marketplace/actions/bencher-cli
78-
[github token]: https://docs.github.com/en/actions/security-guides/automatic-token-authentication
82+
[github token]: https://docs.github.com/de/actions/security-guides/automatic-token-authentication
7983

8084
[statistical continuous benchmarking]: /de/docs/how-to/track-benchmarks/#statistical-continuous-benchmarking
8185
[bencher run]: /de/docs/explanation/bencher-run/

services/console/src/chunks/docs-how-to/github-actions/de/pull-requests-closed.mdx

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,41 +20,29 @@ Dieser Workflow archiviert den PR-Branch mit dem Befehl `bencher archive`.
2020
⚠️ ENTFERNEN SIE NICHT DIESE ZEILE!
2121
Weitere Informationen zum Umgang mit Fork-PRs finden Sie weiter unten unter [Pull Requests von Forks][pull requests from forks].
2222
(z.B.: `if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository`)
23-
5. Setzen Sie [die Berechtigungen für das `GITHUB_TOKEN`][github token permissions]
24-
auf `write` für `pull-requests`.
25-
Abhängig von Ihren GitHub-Einstellungen ist dies möglicherweise nicht erforderlich.
26-
Doch bei allen Organisationen und persönlichen Repositories,
27-
[die nach dem 02. Feb 2023 erstellt wurden][github token read only],
28-
ist dies das Standardverhalten.
29-
Lesen Sie [die GitHub-Dokumentation][github token permissions security]
30-
für einen vollständigen Überblick.
31-
(z.B.: `permissions: pull-requests: write`)
32-
6. Legen Sie den Maschinentyp fest, auf dem der Job ausgeführt werden soll.
23+
5. Legen Sie den Maschinentyp fest, auf dem der Job ausgeführt werden soll.
3324
Lesen Sie die [GitHub Actions `runs-on` Dokumentation][github actions runs-on]
3425
für einen vollständigen Überblick.
3526
(z.B.: `runs-on: ubuntu-latest`)
36-
7. Checken Sie den Quellcode des PR-Branches aus.
27+
6. Checken Sie den Quellcode des PR-Branches aus.
3728
(z.B.: `uses: actions/checkout@v4`)
38-
8. Installieren Sie die Bencher CLI über [die GitHub Action][bencher cli github action].
29+
7. Installieren Sie die Bencher CLI über [die GitHub Action][bencher cli github action].
3930
(z.B.: `uses: bencherdev/bencher@main`)
40-
9. Verwenden Sie den `bencher archive` CLI-Unterbefehl, um den PR-Branch zu archivieren.
31+
8. Verwenden Sie den `bencher archive` CLI-Unterbefehl, um den PR-Branch zu archivieren.
4132
(z.B.: `bencher archive`)
42-
10. Setzen Sie die `--project` Option auf das Projektslug.
33+
9. Setzen Sie die `--project` Option auf das Projektslug.
4334
Siehe [die `--project` Dokumentation][project option] für mehr Details.
4435
(z.B.: `--project save-walter-white-1234abcd`)
45-
11. Setzen Sie die `--token` Option auf das **Repository**-Geheimnis `BENCHER_API_TOKEN`.
36+
10. Setzen Sie die `--token` Option auf das **Repository**-Geheimnis `BENCHER_API_TOKEN`.
4637
Siehe [die `--token` Dokumentation][token option] für mehr Details.
4738
(z.B.: `--token '${{ secrets.BENCHER_API_TOKEN }}'`)
48-
12. Setzen Sie die `--branch` Option auf den Namen des PR-Branches
39+
11. Setzen Sie die `--branch` Option auf den Namen des PR-Branches
4940
mit dem [GitHub Actions `github` Kontext][github actions context].
5041
(z.B.: `--branch '${{ github.head_ref }}'`)
5142

5243

5344
[github actions on]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
5445
[github action pull_request]: https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request
55-
[github token permissions]: https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs#setting-the-github_token-permissions-for-a-specific-job
56-
[github token read only]: https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
57-
[github token permissions security]: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
5846
[github actions runs-on]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
5947
[bencher cli github action]: https://github.com/marketplace/actions/bencher-cli
6048
[github actions context]: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context

services/console/src/chunks/docs-how-to/github-actions/de/pull-requests-fork-closed.mdx

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,28 @@ Dieser Workflow archiviert den Fork-PR-Branch mit dem Befehl `bencher archive`.
1616
(z.B.: `on: pull_request: types: [closed]`)
1717
3. Erstellen Sie einen GitHub Actions `job`.
1818
(z.B.: `jobs: archive_pr_branch`)
19-
4. Setzen Sie [die Berechtigungen für das `GITHUB_TOKEN`][github token permissions]
20-
auf `write` für `pull-requests`.
21-
Abhängig von Ihren GitHub-Einstellungen ist dies möglicherweise nicht erforderlich.
22-
Aber für alle Organisationen und persönlichen Repos
23-
[erstellt nach dem 02. Februar 2023][github token read only],
24-
ist dies das Standardverhalten.
25-
Siehe [die GitHub-Dokumentation][github token permissions security]
26-
für einen vollständigen Überblick.
27-
(z.B.: `permissions: pull-requests: write`)
28-
5. Legen Sie die Art der Maschine fest, auf der der Job ausgeführt wird.
19+
4. Legen Sie die Art der Maschine fest, auf der der Job ausgeführt wird.
2920
Siehe die [GitHub Actions `runs-on` Dokumentation][github actions runs-on]
3021
für einen vollständigen Überblick.
3122
(z.B.: `runs-on: ubuntu-latest`)
32-
6. Überprüfen Sie den PR-Branch-Quellcode.
23+
5. Überprüfen Sie den PR-Branch-Quellcode.
3324
(z.B.: `uses: actions/checkout@v4`)
34-
7. Installieren Sie das Bencher CLI mithilfe [der GitHub Action][bencher cli github action].
25+
6. Installieren Sie das Bencher CLI mithilfe [der GitHub Action][bencher cli github action].
3526
(z.B.: `uses: bencherdev/bencher@main`)
36-
8. Verwenden Sie das CLI-Unterkommando `bencher archive`, um den PR-Branch zu archivieren.
27+
7. Verwenden Sie das CLI-Unterkommando `bencher archive`, um den PR-Branch zu archivieren.
3728
(z.B.: `bencher archive`)
38-
9. Setzen Sie die `--project`-Option auf das Projekt-Slug.
29+
8. Setzen Sie die `--project`-Option auf das Projekt-Slug.
3930
Siehe die [Dokumentation zur `--project` Option][project option] für weitere Details.
4031
(z.B.: `--project save-walter-white-1234abcd`)
41-
10. Setzen Sie die `--token`-Option auf das **Repository**-Geheimnis `BENCHER_API_TOKEN`.
32+
9. Setzen Sie die `--token`-Option auf das **Repository**-Geheimnis `BENCHER_API_TOKEN`.
4233
Siehe die [Dokumentation zur `--token` Option][token option] für weitere Details.
4334
(z.B.: `--token '${{ secrets.BENCHER_API_TOKEN }}'`)
44-
11. Setzen Sie die `--branch`-Option auf den Namen des PR-Branchs
35+
10. Setzen Sie die `--branch`-Option auf den Namen des PR-Branchs
4536
mithilfe [des GitHub Actions `github` Kontexts][github actions context].
4637
(z.B.: `--branch '${{ github.head_ref }}'`)
4738

4839
[github actions on]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
4940
[github action pull_request]: https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request
50-
[github token permissions]: https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs#setting-the-github_token-permissions-for-a-specific-job
51-
[github token read only]: https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
52-
[github token permissions security]: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
5341
[github actions runs-on]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
5442
[bencher cli github action]: https://github.com/marketplace/actions/bencher-cli
5543
[github actions context]: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context

services/console/src/chunks/docs-how-to/github-actions/en/base-branch.mdx

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,35 @@ This historical baseline can then be used to detect performance regressions in P
1616
(ex: `on: push: branches: main`)
1717
3. Create a GitHub Actions `job`.
1818
(ex: `jobs: benchmark_base_branch`)
19-
4. Set the type of machine the job will run on.
19+
4. Set [the permissions for the `GITHUB_TOKEN`][github token permissions]
20+
to `write` for `checks`.
21+
(ex: `permissions: checks: write`)
22+
5. Set the type of machine the job will run on.
2023
See the [GitHub Actions `runs-on` documentation][github actions runs-on]
2124
for a full overview.
2225
(ex: `runs-on: ubuntu-latest`)
23-
5. Checkout your base branch source code.
26+
6. Checkout your base branch source code.
2427
(ex: `uses: actions/checkout@v4`)
25-
6. Install the Bencher CLI using [the GitHub Action][bencher cli github action].
28+
7. Install the Bencher CLI using [the GitHub Action][bencher cli github action].
2629
(ex: `uses: bencherdev/bencher@main`)
27-
7. Use the <code><a href="/docs/explanation/bencher-run/">bencher run</a></code> CLI subcommand
30+
8. Use the <code><a href="/docs/explanation/bencher-run/">bencher run</a></code> CLI subcommand
2831
to run your `main` branch benchmarks.
2932
See [the `bencher run` CLI subcommand][bencher run] for a full overview.
3033
(ex: `bencher run`)
31-
8. Set the `--project` option to the Project slug.
34+
9. Set the `--project` option to the Project slug.
3235
See [the `--project` docs][project option] for more details.
3336
(ex: `--project save-walter-white-1234abcd`)
34-
9. Set the `--token` option to the `BENCHER_API_TOKEN` **Repository** secret.
37+
10. Set the `--token` option to the `BENCHER_API_TOKEN` **Repository** secret.
3538
See [the `--token` docs][token option] for more details.
3639
(ex: `--token '${{ secrets.BENCHER_API_TOKEN }}'`)
37-
10. Set the `--branch` option to the base Branch name.
40+
11. Set the `--branch` option to the base Branch name.
3841
See [the `--branch` docs][branch option] for a full overview.
3942
(ex: `--branch main`)
40-
11. Set the `--testbed` option to the Testbed name.
43+
12. Set the `--testbed` option to the Testbed name.
4144
This should likely match the machine selected in `runs-on`.
4245
See [the `--tested` docs][testbed option] for more details.
4346
(ex: `--testbed ubuntu-latest`)
44-
12. Set the Threshold for the `main` Branch, `ubuntu-latest` Testbed, and `latency` Measure:
47+
13. Set the Threshold for the `main` Branch, `ubuntu-latest` Testbed, and `latency` Measure:
4548
1. Set the `--threshold-measure` option to the built-in `latency` Measure that is generated by <code><a href="/docs/reference/bencher-metric-format/#bencher-mock">bencher mock</a></code>.
4649
See [the `--threshold-measure` docs][threshold measure option] for more details.
4750
(ex: `--threshold-measure latency`)
@@ -57,22 +60,23 @@ This historical baseline can then be used to detect performance regressions in P
5760
5. Set the `--thresholds-reset` flag so that only the specified Threshold is active.
5861
See [the `--thresholds-reset` docs][thresholds reset] for a full overview.
5962
(ex: `--thresholds-reset`)
60-
13. Set the `--err` flag to fail the command if an Alert is generated.
63+
14. Set the `--err` flag to fail the command if an Alert is generated.
6164
See [the `--err` docs][alert err] for a full overview.
6265
(ex: `--err`)
63-
14. Set the `--adapter` option to [Bencher Metric Format JSON (`json`)][bmf] that is generated by <code><a href="/docs/reference/bencher-metric-format/#bencher-mock">bencher mock</a></code>.
66+
15. Set the `--adapter` option to [Bencher Metric Format JSON (`json`)][bmf] that is generated by <code><a href="/docs/reference/bencher-metric-format/#bencher-mock">bencher mock</a></code>.
6467
See [benchmark harness adapters][adapter json] for a full overview.
6568
(ex: `--adapter json`)
66-
15. Set the `--github-actions` option to the GitHub API authentication token to post results as a GitHub Checks comment using
69+
16. Set the `--github-actions` option to the GitHub API authentication token to post results as a GitHub Checks comment using
6770
[the GitHub Actions `GITHUB_TOKEN` environment variable][github token].
6871
See [the `--github-actions` docs][github actions option] for more details.
6972
(ex: `--github-actions '${{ secrets.GITHUB_TOKEN }}'`)
70-
16. Specify the benchmark command arguments.
73+
17. Specify the benchmark command arguments.
7174
See [benchmark command][command argument] for a full overview.
7275
(ex: `bencher mock`)
7376

7477
[github actions on]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
7578
[github actions push]: https://docs.github.com/en/webhooks/webhook-events-and-payloads#push
79+
[github token permissions]: https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs#setting-the-github_token-permissions-for-a-specific-job
7680
[github actions runs-on]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
7781
[bencher cli github action]: https://github.com/marketplace/actions/bencher-cli
7882
[github token]: https://docs.github.com/en/actions/security-guides/automatic-token-authentication

0 commit comments

Comments
 (0)