Skip to content

Commit 2f18ecd

Browse files
llucaxCopilot
andcommitted
Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
1 parent ba0127c commit 2f18ecd

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

cookiecutter/migrate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,8 @@ def migrate_gh_actions_hashes() -> None:
356356
# GITHUB_TOKEN is read-only and secrets are unavailable with a plain
357357
# pull_request trigger. The action mitigates the risk by:
358358
# - Never executing code from the PR (the migration script is fetched
359-
# from the repo-config branch configured below, not taken from the PR).
359+
# remotely via script-url-template configured in this workflow on the
360+
# base branch, not taken from the PR branch contents).
360361
# - Gating migration steps on github.actor == 'dependabot[bot]' AND the
361362
# PR title.
362363
# - Running checkout with persist-credentials: false and isolating

cookiecutter/{{cookiecutter.github_repo_name}}/.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ updates:
4343
- "async-solipsism"
4444
{%- if cookiecutter.type == "api" %}
4545
- "frequenz-api-common"
46-
# These need a migration script to fix dependabot missing updating
46+
# These need a migration script because Dependabot does not update
4747
# the runtime dependencies
4848
- "grpcio"
4949
- "grpcio-tools"

cookiecutter/{{cookiecutter.github_repo_name}}/.github/workflows/grpc-migration.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
# This is required because Dependabot PRs are treated as fork PRs: the
2525
# GITHUB_TOKEN is read-only and secrets are unavailable with a plain
2626
# pull_request trigger. The action mitigates the risk by:
27-
# - Never executing code from the PR (the migration script is fetched
28-
# from the repo-config branch configured below, not taken from the PR).
27+
# - Never executing code from the PR. The migration script is fetched
28+
# remotely via `script-url-template` from a trusted pinned location.
2929
# - Gating migration steps on github.actor == 'dependabot[bot]' AND the
3030
# PR title.
3131
# - Running checkout with persist-credentials: false and isolating

docs/user-guide/advanced-usage.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,8 @@ PR branch.
211211
The workflow uses the
212212
[`dependabot-grpc-fixer.py`][dependabot-grpc-fixer] script shipped by
213213
this repository. Shipping it as a separate script makes it easy to keep
214-
all API projects updated to the latest version without regenerating the
215-
workflow file: [Dependabot] tracks the action and the workflow stays
216-
short.
214+
all API projects updated without regenerating the workflow file, and the
215+
workflow itself stays short.
217216

218217
The companion `auto-dependabot.yaml` workflow skips the
219218
`grpc-compatible`, `grpcio-major` and `protobuf-major` Dependabot groups
@@ -222,6 +221,8 @@ so those PRs are handled exclusively by this migration workflow.
222221
The migration script lives at
223222
`cookiecutter/scripts/dependabot-grpc-fixer.py` in this repository, and
224223
the workflow fetches it from the URL configured in `script-url-template`.
224+
The script should be fetched from an immutable release tag or commit
225+
SHA from a trusted source.
225226

226227
### Creating the caller workflow
227228

0 commit comments

Comments
 (0)