Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
04814c0
make policy rego dynamic, simplify documentation-flow
5byuri Jan 2, 2026
86ac32d
yaml to yml
5byuri Jan 2, 2026
80832c9
make it reuseable
5byuri Jan 2, 2026
ee469c5
yaml to yml
5byuri Jan 2, 2026
1d9dec3
fix typo
5byuri Jan 2, 2026
c90765f
remove app/
5byuri Jan 5, 2026
6e85541
direct path
5byuri Jan 5, 2026
d0738c1
add debug
5byuri Jan 5, 2026
031f608
add direct path
5byuri Jan 5, 2026
c0b8d92
update path
5byuri Jan 5, 2026
c89cfac
added documentation_check
5byuri Jan 5, 2026
1aec315
add dynamic policy file
5byuri Jan 5, 2026
3fbdea3
create policy_rego file
5byuri Jan 5, 2026
2a80643
added path
5byuri Jan 5, 2026
b65cbd5
rm line
5byuri Jan 5, 2026
aac8f1d
add documentation
5byuri Jan 5, 2026
914568a
added json_path
5byuri Jan 26, 2026
97dba5e
correct registry path
5byuri Jan 26, 2026
fef587c
_
5byuri Jan 26, 2026
3879372
removing s
5byuri Jan 26, 2026
c476b55
fix typo and \ misplacement
5byuri Jan 26, 2026
698e823
remove another s ._.
5byuri Jan 26, 2026
5a64f18
s
5byuri Jan 26, 2026
613d828
add naming-convention
5byuri Jan 27, 2026
a4aa7a4
hashtag -> $
5byuri Jan 27, 2026
dd8c299
added new rule config
5byuri Jan 27, 2026
0a2af8a
/tmp/doc_repo.json
5byuri Jan 27, 2026
75789d6
fix opa eval
5byuri Jan 27, 2026
22e995a
update docu-policy
5byuri Jan 27, 2026
5d3bb3c
nameing convention
5byuri Jan 27, 2026
9e4c782
add id for debug
5byuri Jan 27, 2026
16fda30
NODE ID
5byuri Jan 27, 2026
ad3f4df
use real pull request title
5byuri Jan 27, 2026
d77a951
added repo checkout
5byuri Feb 2, 2026
318e6e2
fix pipeline
5byuri Feb 2, 2026
0457208
change path
5byuri Feb 2, 2026
94de6f1
fix path 2
5byuri Feb 2, 2026
4ab989d
corrected policies
5byuri Feb 2, 2026
31f59d9
debug
5byuri Feb 2, 2026
44e1c57
change path
5byuri Feb 2, 2026
cd1d9e8
use title instead
5byuri Feb 2, 2026
cfc298e
attestation path
5byuri Feb 2, 2026
576ce02
create safe json with jq
5byuri Feb 2, 2026
bb48f07
install jq
5byuri Feb 2, 2026
739bf67
remove sudo
5byuri Feb 2, 2026
0c5c112
move jq to docker
5byuri Feb 2, 2026
1953078
update naming convention.yml
5byuri Feb 2, 2026
d5ee142
move download opa up
5byuri Feb 2, 2026
20dd5ad
fix
5byuri Feb 2, 2026
fedfa89
add policies to path
5byuri Feb 2, 2026
81eafc5
fix pr_title input
5byuri Feb 2, 2026
7573dce
remove redundant yml
5byuri Feb 2, 2026
5d333bc
remove paste
5byuri Feb 2, 2026
3e6e0a3
change description
5byuri Feb 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions .github/workflows/docu-policy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Cross Repository Issue Consumer

on:
workflow_call:
inputs:
documentation_repo:
type: string
required: true
description: "Write down the Documentation Repository that needs to be merged first"

production_repo:
type: string
required: true
description: "Write down every repository that has to wait for documentation to be merged first."

json_path:
type: string
required: false
description: "Write down the JSONPath filter expression to filter the issues (optional)"


jobs:
attestor:
runs-on: ubuntu-latest
container: ghcr.io/l3montree-dev/compliance-as-code-witness:latest
env:
PR_NUMBER: ${{ github.event.number }}
PR_TITLE: /tmp/pr_title
ATTESTATION_FILE: /tmp/attest.json
POLICY_REGO: /tmp/policy.rego
DOCUMENTATION_REPO: /tmp/doc_repo.json
MERGE_COMMIT_SHA: ${{ github.sha }}
NODE_ID : ${{ github.event.pull_request.node_id }}

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Env Sanity Check
run: echo $MERGE_COMMIT_SHA

- name: Debug binary
run: |
ls -la /usr/local/bin
which compliance-as-code-witness || true
/usr/local/bin/compliance-as-code-witness --help || true

- name: Pull Request Check
run: |
/usr/local/bin/compliance-as-code-witness github issue \
--repository "${{ inputs.documentation_repo }}" \
--repository "${{ inputs.production_repo }}" \
--filter="${{ inputs.json_path }}" > "$ATTESTATION_FILE"
cat "$ATTESTATION_FILE"
echo "created $ATTESTATION_FILE"

- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: attestation- ${{ env.MERGE_COMMIT_SHA }}
path: ${{ env.ATTESTATION_FILE }}

- name: Checkout Attestation Repository
uses: actions/checkout@v4
with:
repository: l3montree-dev/attestation-compliance-policies
ref: documentation_policy_check.rego
path: attestation-policies

- name: Debug checkout
run: |
pwd
ls -la
ls -la attestation-policies

- name: Download OPA
uses: open-policy-agent/setup-opa@v2
with:
version: 1.10.1

- name: id to title rego
run: |
echo '{"node_id": "${{ env.NODE_ID }}"}' > /tmp/id-to-name.json
opa eval \
--data attestation-policies/policies/node_id_to_title.rego \
--data /tmp/id-to-name.json \
--input "$ATTESTATION_FILE" \
--format raw \
'data.id_to_name.main' > $PR_TITLE
cat $PR_TITLE

- name: Summarize Input
run: |
jq -n \
--arg documentation_repo "${{ inputs.documentation_repo }}" \
--arg production_repo "${{ inputs.production_repo }}" \
--arg pull_request_title "$(cat "$PR_TITLE")" \
'{documentation_repo:$documentation_repo, production_repo:$production_repo, pull_request_title:$pull_request_title}' \
> /tmp/doc_repo.json

cat /tmp/doc_repo.json

- name: Documentation Policy Check
run: |
opa eval \
--data attestation-policies/policies/documentation_policy_check.rego \
--data /tmp/doc_repo.json \
--input "$ATTESTATION_FILE" \
'data.documentationMerged.failure_msg[_]' \
--format raw \
--fail-defined




119 changes: 119 additions & 0 deletions .github/workflows/naming-convention.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Copyright 2026 larshermges
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


name: Naming Convention Check

on:
workflow_call:
inputs:
repositories:
type: string
required: true
description: "org/repo,org/repo2,.... seperate repository with a comma"

ticket_repo:
type: string
required: true
description: "Write down the Repository where the ticket are created"

json_path:
type: string
required: false
description: "Write down the JSONPath filter expression to filter the issues (optional)"


jobs:
naming-convention:
runs-on: ubuntu-latest
container: ghcr.io/l3montree-dev/compliance-as-code-witness:latest
env:
PR_NUMBER: ${{ github.event.number }}
PR_TITLE: /tmp/pr_title
ATTESTATION_FILE: /tmp/attest.json
POLICY_REGO: /tmp/policy.rego
MERGE_COMMIT_SHA: ${{ github.sha }}
NODE_ID : ${{ github.event.pull_request.node_id }}


steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Env Sanity Check
run: echo $MERGE_COMMIT_SHA && echo $PR_TITLE

- name: Debug binary
run: |
ls -la /usr/local/bin
which compliance-as-code-witness || true
/usr/local/bin/compliance-as-code-witness --help || true

- name: Pull Request Check
run: |
/usr/local/bin/compliance-as-code-witness github issue \
--repository "${{ inputs.repositories }}" \
--filter="${{ inputs.json_path }}" > "$ATTESTATION_FILE"
cat "$ATTESTATION_FILE"
echo "created $ATTESTATION_FILE"

- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: attestation-${{ env.MERGE_COMMIT_SHA }}
path: ${{ env.ATTESTATION_FILE }}

- name: Checkout Attestation Repository
uses: actions/checkout@v4
with:
repository: l3montree-dev/attestation-compliance-policies
ref: documentation_policy_check.rego
path: attestation-policies

- name: Download OPA
uses: open-policy-agent/setup-opa@v2
with:
version: 1.10.1

- name: id to title rego
run: |
echo '{"node_id": "${{ env.NODE_ID }}"}' > /tmp/id-to-name.json
opa eval \
--data attestation-policies/policies/node_id_to_title.rego \
--data /tmp/id-to-name.json \
--input "$ATTESTATION_FILE" \
--format raw \
'data.id_to_name.main' > $PR_TITLE
cat $PR_TITLE


- name: Summarize Input
run: |
jq -n \
--arg pull_request_title "$(cat "$PR_TITLE")" \
--arg ticket_repo "${{ inputs.ticket_repo }}" \
'{pull_request_title:$pull_request_title, ticket_repo:$ticket_repo}' \
> /tmp/doc_repo.json

cat /tmp/doc_repo.json

- name: Evaluate Policy
run: |
opa eval \
--data attestation-policies/policies/pull_request_ticket_naming_convention.rego \
--data /tmp/doc_repo.json \
--input "$ATTESTATION_FILE" \
'data.pr_title_ticket_gate.failure_msg[msg]' \
--format raw \
--fail-defined