Skip to content

Commit e82f88b

Browse files
committed
docs: Update how to configure the migration workflow
Introduces the security improvements, but also some old improvements that were not updated before. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
1 parent d8e3946 commit e82f88b

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

docs/user-guide/advanced-usage.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@ Create `.github/workflows/repo-config-migration.yaml` in your repository:
4242
name: Repo Config Migration
4343

4444
on:
45+
merge_group: # To allow using this as a required check for merging
4546
pull_request_target:
4647
types: [opened, synchronize, reopened, labeled, unlabeled]
4748

4849
permissions:
50+
# Commit migration changes back to the PR branch.
4951
contents: write
52+
# Create and normalize migration state labels.
5053
issues: write
54+
# Read/update pull request metadata and comments.
5155
pull-requests: write
5256

5357
jobs:
@@ -62,6 +66,14 @@ jobs:
6266
with:
6367
app-id: ${{ secrets.FREQUENZ_AUTO_DEPENDABOT_APP_ID }}
6468
private-key: ${{ secrets.FREQUENZ_AUTO_DEPENDABOT_APP_PRIVATE_KEY }}
69+
# Push migration commits to the PR branch.
70+
permission-contents: write
71+
# Manage labels when auto-merging patch-only updates.
72+
permission-issues: write
73+
# Approve pull requests and enable auto-merge.
74+
permission-pull-requests: write
75+
# Allow pushes when migration changes workflow files.
76+
permission-workflows: write
6577
- name: Migrate
6678
uses: frequenz-floss/gh-action-dependabot-migrate@07dc7e74726498c50726a80cc2167a04d896508f # v1.0.0
6779
with:
@@ -93,6 +105,8 @@ The key repo-config-specific settings are:
93105
when applicable).
94106
Because it is not `GITHUB_TOKEN`, API calls made with this token trigger
95107
follow-up workflows (merge queue CI, status checks, etc.).
108+
Scope this token explicitly with `permission-*` inputs when creating it
109+
(`contents`, `issues`, `pull-requests`, and `workflows` write).
96110
* **`migration-token`** — a token exposed to the migration script as
97111
`GH_TOKEN` / `GITHUB_TOKEN` for authenticated GitHub API calls (e.g.
98112
updating repository settings or branch rulesets).
@@ -108,6 +122,8 @@ The key repo-config-specific settings are:
108122
* **`if` condition** — matches PRs with `the repo-config group` in the
109123
title, which is how [Dependabot] names PRs for the `repo-config`
110124
dependency group.
125+
* **`merge_group` trigger** — lets you use the workflow as a required check in
126+
repositories that gate merges through the merge queue.
111127

112128
!!! Warning "Security"
113129

0 commit comments

Comments
 (0)