forgejo-mcp/.tekton/release-tools-on-pull-request-build.yaml
Christoph Görn 3a12931fb7
fix: 💚 PaC task annotation YAML folding — collapse to single-line bracketed list
PipelinesAsCode failed validating PR #172 with:
  error getting remote task from pipelinerun annotations:
  annotations in pipeline are in wrong format: [git-clone,\n ...]

Root cause: the `pipelinesascode.tekton.dev/task` annotation used a
folded scalar (>-) where every continuation line was indented one
space deeper than the first content line `[git-clone,`. YAML 1.2
preserves newlines under that indent pattern (line-more-indented
rule), so PaC saw a literal multi-line string instead of a flat
bracketed list.

Collapse the two affected annotations to single double-quoted
inline lists. Verified via yq that each annotation parses to a
flat string with no embedded newlines.

Affects PR-build and tag-publish pipelines for the release-tools
image. No behaviour change beyond making PaC accept the manifest.

Closes forgejo-mcp-wbw.
Ref PR #172 comment https://codeberg.org/goern/forgejo-mcp/pulls/172#issuecomment-16027445
2026-05-28 17:35:52 +02:00

88 lines
2.7 KiB
YAML

apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: release-tools-on-pull-request-build
annotations:
pipelinesascode.tekton.dev/on-event: "[pull_request]"
pipelinesascode.tekton.dev/on-target-branch: "[main]"
# A4 patch: files.exists (CEL list macro) — fires when ANY changed file
# is under the release-tools trees. files.all would silently skip hybrid
# PRs (image change + unrelated typo fix elsewhere).
pipelinesascode.tekton.dev/on-cel-expression: |
event == "pull_request" && target_branch == "main" &&
files.exists(p, p.matches("^(image/release-tools/|\\.tekton/release-tools).*"))
pipelinesascode.tekton.dev/task: "[git-clone, .tekton/release-tools/tasks/build-image.yaml, .tekton/release-tools/tasks/verify-image-tools.yaml, .tekton/release-tools/tasks/syft-scan-image.yaml]"
pipelinesascode.tekton.dev/max-keep-runs: "5"
pipelinesascode.tekton.dev/cancel-in-progress: "true"
spec:
params:
- name: repo_url
value: "{{ repo_url }}"
- name: revision
value: "{{ revision }}"
pipelineSpec:
params:
- name: repo_url
- name: revision
workspaces:
- name: source
tasks:
- name: fetch-source
taskRef:
name: git-clone
workspaces:
- name: output
workspace: source
params:
- name: url
value: $(params.repo_url)
- name: revision
value: $(params.revision)
- name: build-image
taskRef:
name: release-tools-build-image
runAfter:
- fetch-source
workspaces:
- name: source
workspace: source
params:
- name: IMAGE
value: "release-tools:pr-$(context.pipelineRun.name)"
- name: CONTEXT
value: image/release-tools
- name: CONTAINERFILE
value: Containerfile
- name: verify-tools
taskRef:
name: release-tools-verify-image-tools
runAfter:
- build-image
params:
- name: IMAGE_REF
value: $(tasks.build-image.results.IMAGE_REF)
- name: scan-sbom
taskRef:
name: release-tools-syft-scan-image
runAfter:
- verify-tools
workspaces:
- name: source
workspace: source
params:
- name: IMAGE_REF
value: $(tasks.build-image.results.IMAGE_REF)
workspaces:
- name: source
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
# Image build workspace: full repo checkout + buildah layer cache.
storage: 10Gi