Skip to content

Commit af39ffa

Browse files
Nitjsefnieclaude
andcommitted
docs: clarify that job-level actions replace the top-level actions (#443)
A job that defines its own `actions` replaces the whole top-level `actions` mapping rather than merging per action, so it inherits none of the top-level actions. Add a worked example to the existing caution and fix the `action` -> `actions` typo. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 31b5b8a commit af39ffa

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

‎docs/configuration/actions.md‎

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,34 @@ e.g. cloning an upstream repo.
3939
:::caution
4040

4141
Like other keys, the `actions` can be defined on the top, package or job level.
42-
Be aware that when overriding, the whole `action` mapping is replaced
43-
instead of merging.
42+
Be aware that when overriding, the whole `actions` mapping is replaced
43+
instead of merged per action. In other words, a job that defines its own
44+
`actions` does **not** inherit any of the top-level actions — only the ones it
45+
lists itself are applied.
46+
47+
For example:
48+
49+
```yaml
50+
actions:
51+
post-upstream-clone:
52+
- echo "top-level clone"
53+
create-archive:
54+
- echo "top-level archive"
55+
fix-spec-file:
56+
- echo "top-level spec fix"
57+
58+
jobs:
59+
- job: copr_build
60+
trigger: pull_request
61+
actions:
62+
create-archive:
63+
- echo "job archive"
64+
```
65+
66+
For the `copr_build` job above, only `create-archive` runs (executing
67+
`echo "job archive"`). The top-level `post-upstream-clone` and `fix-spec-file`
68+
actions are **not** applied to this job, because its `actions` mapping replaces
69+
the top-level one as a whole rather than being merged into it.
4470

4571
If you want to reduce duplications, you can use the following YAML syntax to do this:
4672

0 commit comments

Comments
 (0)