Commit ac692e1
authored
chore: fix permissions for called workflow (#1934)
## Summary
Follow-up to
open-component-model/ocm-integrationtest#90,
which hardens the called integration test workflow by removing the
OCMBOT token generation and switching to unprivileged checkouts.
## Changes
- **Downgrade `contents: write` to `contents: read`**: The called
workflow no longer requires write access (report upload and repo pushes
were removed in the companion PR).
- **Remove `secrets: inherit`**: The called workflow no longer declares
any `workflow_call` secrets — OCMBOT tokens are not needed since both
repos are public and only read access is required.
- **Switch `pull_request_target` to `pull_request`**: The
`pull_request_target` trigger was only needed because the called
workflow required secrets to generate a token for checkout. Now that no
secrets are needed, plain `pull_request` provides the same functionality
without the security risk of running untrusted fork code with access to
repo secrets.
- **Remove job-level `permissions` block**: The old called workflow
required `contents: write`, `id-token: write`, and `packages: write`,
which had to be explicitly granted at the job level since the caller's
top-level permissions didn't include them. After the companion PR, the
called workflow only needs `contents: read`, which is already covered by
the caller's top-level `permissions` block — no additional job-level
escalation is needed.
- **Pin called workflow to commit SHA**: The `@main` reference is now
pinned to `8b914397e79353d1f0b441295d7b1d36676849c3` to address the
`unpinned-uses` finding from zizmor.
## Dependencies
This PR must be merged **after**
open-component-model/ocm-integrationtest#90,
which removes the secrets requirement and token generation from the
called workflow. (Already merged.)
---------
Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>1 parent 8fefc86 commit ac692e1
1 file changed
Lines changed: 5 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 13 | + | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 18 | + | |
26 | 19 | | |
27 | | - | |
28 | | - | |
| 20 | + | |
| 21 | + | |
0 commit comments