From 8cdca7bfe514353f659d260341c592e53daa946f Mon Sep 17 00:00:00 2001 From: Jose Ignacio Paris Prieto Date: Thu, 12 Nov 2026 16:57:25 +0100 Subject: [PATCH 1/2] fix(ci): remove workflow_dispatch inputs from the decisions reconcile workflow Checkov CKV_GHA_7 requires workflow_dispatch inputs to be empty, so that user parameters cannot change the build output. A manual run is now a dry run of all areas. Refs: PFM-8171 Assisted-by: Claude Code Signed-off-by: Jose Ignacio Paris Prieto Chainloop-Trace-Sessions: 23e61960-55dc-47f2-8ca7-1ef8f3ca103a --- .github/workflows/decisions_reconcile.yml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/decisions_reconcile.yml b/.github/workflows/decisions_reconcile.yml index 723f1a82d..6258bcfe8 100644 --- a/.github/workflows/decisions_reconcile.yml +++ b/.github/workflows/decisions_reconcile.yml @@ -2,7 +2,8 @@ # Reconcile of the Current Decisions pages (docs/decisions/) # ============================================================================= # Runs the `eng-adr reconcile` skill of chainloop-dev/brain with Claude Code. -# Runs on weekdays, and on a manual start. When the pages change, it opens or updates one draft PR. +# Runs on weekdays, and on a manual start. When the pages change, a scheduled run opens or updates one draft PR. +# A manual run is a dry run: it uploads the diff and the PR body as an artifact. # # The skill runs in its scheduled mode: it asks no questions, writes only the # changes that need no person, and lists the open questions in the PR body. @@ -37,17 +38,9 @@ on: schedule: # 05:00 UTC, Monday to Friday. - cron: "0 5 * * 1-5" + # No inputs: user parameters must not change the build output (Checkov CKV_GHA_7, SLSA). A manual run is a + # dry run of all areas. workflow_dispatch: - inputs: - area: - description: "Reconcile only this area. Leave blank for all areas." - required: false - type: string - dry_run: - description: "Do not open a PR. Upload the diff and the PR body as an artifact. Clear it to open the PR." - required: false - default: true - type: boolean permissions: {} @@ -60,8 +53,8 @@ env: # in place of the numeric App ID to sign the app JWT, so it goes in the app-id input. CHAINLOOP_ENG_APP_CLIENT_ID: Iv23liu5FUQ9TuCCdxpP PR_BRANCH: decisions-reconcile-scheduled - # A scheduled run opens a PR. A manual run opens a PR only when dry_run is cleared. - DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }} + # A scheduled run opens a PR. A manual run does not open a PR: it uploads the diff and the PR body as an artifact. + DRY_RUN: ${{ github.event_name == 'workflow_dispatch' }} jobs: reconcile: @@ -131,7 +124,6 @@ jobs: - name: Prepare reconcile run id: prepare env: - AREA: ${{ inputs.area }} OUT_DIR: ${{ runner.temp }}/decisions run: | mkdir -p "$OUT_DIR" @@ -139,7 +131,7 @@ jobs: { echo "prompt< Date: Thu, 12 Nov 2026 17:29:11 +0100 Subject: [PATCH 2/2] fix(ci): keep the decisions reconcile inputs and suppress CKV_GHA_7 Refs: PFM-8171 Assisted-by: Claude Code Signed-off-by: Jose Ignacio Paris Prieto Chainloop-Trace-Sessions: 23e61960-55dc-47f2-8ca7-1ef8f3ca103a --- .github/workflows/decisions_reconcile.yml | 40 +++++++++++++++++++---- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/decisions_reconcile.yml b/.github/workflows/decisions_reconcile.yml index 6258bcfe8..314766f85 100644 --- a/.github/workflows/decisions_reconcile.yml +++ b/.github/workflows/decisions_reconcile.yml @@ -2,8 +2,7 @@ # Reconcile of the Current Decisions pages (docs/decisions/) # ============================================================================= # Runs the `eng-adr reconcile` skill of chainloop-dev/brain with Claude Code. -# Runs on weekdays, and on a manual start. When the pages change, a scheduled run opens or updates one draft PR. -# A manual run is a dry run: it uploads the diff and the PR body as an artifact. +# Runs on weekdays, and on a manual start. When the pages change, it opens or updates one draft PR. # # The skill runs in its scheduled mode: it asks no questions, writes only the # changes that need no person, and lists the open questions in the PR body. @@ -38,9 +37,22 @@ on: schedule: # 05:00 UTC, Monday to Friday. - cron: "0 5 * * 1-5" - # No inputs: user parameters must not change the build output (Checkov CKV_GHA_7, SLSA). A manual run is a - # dry run of all areas. workflow_dispatch: + # The inputs only narrow the reconcile to one area and choose a dry run. They do not change what a build + # produces: this workflow builds no artifact, and only users with write access can start it. "area" reaches + # the script through env, and "Prepare reconcile run" accepts only the page name of an area in the index, so + # no free text reaches Claude's prompt. + # checkov:skip=CKV_GHA_7:The inputs select the reconcile scope and a dry run; the workflow builds no artifact. + inputs: + area: + description: "Reconcile only this area: the page name of the area in docs/decisions/README.md, for example artifact-cas. Leave blank for all areas." + required: false + type: string + dry_run: + description: "Do not open a PR. Upload the diff and the PR body as an artifact. Clear it to open the PR." + required: false + default: true + type: boolean permissions: {} @@ -53,8 +65,8 @@ env: # in place of the numeric App ID to sign the app JWT, so it goes in the app-id input. CHAINLOOP_ENG_APP_CLIENT_ID: Iv23liu5FUQ9TuCCdxpP PR_BRANCH: decisions-reconcile-scheduled - # A scheduled run opens a PR. A manual run does not open a PR: it uploads the diff and the PR body as an artifact. - DRY_RUN: ${{ github.event_name == 'workflow_dispatch' }} + # A scheduled run opens a PR. A manual run opens a PR only when dry_run is cleared. + DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }} jobs: reconcile: @@ -124,14 +136,28 @@ jobs: - name: Prepare reconcile run id: prepare env: + AREA: ${{ inputs.area }} OUT_DIR: ${{ runner.temp }}/decisions run: | + fail() { echo "::error::$1"; exit 1; } mkdir -p "$OUT_DIR" + # The area goes into Claude's prompt. Accept only the page name of an area in the index, and pass the + # area name from the index, never the input text. + AREA_NAME="" + if [ -n "$AREA" ]; then + [[ "$AREA" =~ ^[a-z0-9]+(-[a-z0-9]+)*$ ]] || fail "area: use the page name of an area, for example artifact-cas." + AREA_NAME=$(awk -v page="**Page:** [${AREA}.md]" \ + '/^### /{name=substr($0,5)} index($0,page)>0 && name!=""{print name; exit}' \ + docs/decisions/README.md) + [ -n "$AREA_NAME" ] || fail "area: docs/decisions/README.md has no area with the page ${AREA}.md." + echo "Area: ${AREA_NAME}" + fi + { echo "prompt<