From af39ffa2feda7591880eec9ef897029aeb87a4bb Mon Sep 17 00:00:00 2001 From: Nitjsefnie Date: Thu, 16 Jul 2026 16:02:06 +0000 Subject: [PATCH] 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 --- docs/configuration/actions.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/docs/configuration/actions.md b/docs/configuration/actions.md index 1e7aca1750..1c19bf10fc 100644 --- a/docs/configuration/actions.md +++ b/docs/configuration/actions.md @@ -39,8 +39,34 @@ e.g. cloning an upstream repo. :::caution Like other keys, the `actions` can be defined on the top, package or job level. -Be aware that when overriding, the whole `action` mapping is replaced -instead of merging. +Be aware that when overriding, the whole `actions` mapping is replaced +instead of merged per action. In other words, a job that defines its own +`actions` does **not** inherit any of the top-level actions — only the ones it +lists itself are applied. + +For example: + +```yaml +actions: + post-upstream-clone: + - echo "top-level clone" + create-archive: + - echo "top-level archive" + fix-spec-file: + - echo "top-level spec fix" + +jobs: + - job: copr_build + trigger: pull_request + actions: + create-archive: + - echo "job archive" +``` + +For the `copr_build` job above, only `create-archive` runs (executing +`echo "job archive"`). The top-level `post-upstream-clone` and `fix-spec-file` +actions are **not** applied to this job, because its `actions` mapping replaces +the top-level one as a whole rather than being merged into it. If you want to reduce duplications, you can use the following YAML syntax to do this: