Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

[![Self-test EN16931 action](https://github.com/facturxapi/validate-einvoice/actions/workflows/selftest.yml/badge.svg)](https://github.com/facturxapi/validate-einvoice/actions/workflows/selftest.yml) [![EN16931 upstream drift](https://github.com/facturxapi/validate-einvoice/actions/workflows/upstream-drift.yml/badge.svg)](https://github.com/facturxapi/validate-einvoice/actions/workflows/upstream-drift.yml) [![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Validate%20EN16931-blue?logo=github)](https://github.com/marketplace/actions/validate-en16931-e-invoice)

GitHub Action that runs the official ConnectingEurope EN16931 XSLT
GitHub Action that runs the official ConnectingEurope EN 16931 XSLT
artefacts (CII and UBL) on XML invoices and reports every
`svrl:failed-assert`: 1.3.16 by default, 1.3.17 opt-in until it takes
effect on 15/11/26.
`svrl:failed-assert`: 1.3.17 by default (in force since 15/11/26),
1.3.16 on request.

A green job means: the vendored stylesheets of the selected version
(1.3.16 by default, 1.3.17 with `version: '1.3.17'`) produced zero
(1.3.17 by default, 1.3.16 with `version: '1.3.16'`) produced zero
`svrl:failed-assert` on the files you passed. The Action does not call
a remote API, does not read PDF attachments, and does not certify a
document.
Expand All @@ -19,19 +19,19 @@ document.

| Ref | What it is |
|---|---|
| `@v1` | **Mutable** major tag (Marketplace channel). It moves to each new `v1.x.y`; it points at `v1.2.0` (EN16931 1.3.16 by default, 1.3.17 opt-in). |
| `@v1.2.0` | Release tag, never moved once published. Default rules 1.3.16; `version: '1.3.17'` selects 1.3.17. |
| `@v1.1.2` | Previous release, 1.3.16 only (`a805a904f9fa1a7d51db5a4160e863748cc3733d`). |
| `@v1` | **Mutable** major tag (Marketplace channel). It moves to each new `v1.x.y`; it points at `v1.3.0` (EN 16931 1.3.17 by default). |
| `@v1.3.0` | Release tag, never moved once published. Default rules 1.3.17; `version: '1.3.16'` still selects 1.3.16. |
| `@v1.2.0` | Previous release: default rules 1.3.16, 1.3.17 opt-in. |
| `@v1.1.2` | Older release, 1.3.16 only (`a805a904f9fa1a7d51db5a4160e863748cc3733d`). |
| Full commit SHA of a release | The frozen tree. Each release's notes give it. |

### EN16931 1.3.17: opt-in until 15/11/26
### EN 16931 1.3.17: the default since `v1.3.0`

The Commission's [registry of EN16931 artefacts](https://ec.europa.eu/digital-building-blocks/sites/spaces/DIGITAL/pages/467108974/Registry+of+supporting+artefacts+to+implement+EN16931)
lists 1.3.17 as published on 12/10/26 and in force from 15/11/26. Until
then 1.3.16 stays the default and 1.3.17 is opt-in: set
`version: '1.3.17'`. A later release, `v1.3.0` (planned for 16/11/26),
makes 1.3.17 the default and `@v1` will move to it; `version: '1.3.16'`
will still select 1.3.16.
The Commission's [registry of EN 16931 artefacts](https://ec.europa.eu/digital-building-blocks/sites/spaces/DIGITAL/pages/467108974/Registry+of+supporting+artefacts+to+implement+EN16931)
lists 1.3.17 as published on 12/10/26 and in force from 15/11/26.
`v1.3.0` makes it the default, so a workflow on `@v1` runs the new rules
and can see new or renamed rule ids. To keep 1.3.16, set
`version: '1.3.16'` or pin `v1.2.0`.

1.3.17 renames the IGIC and IPSI rules (upstream
[#519](https://github.com/ConnectingEurope/eInvoicing-EN16931/issues/519)),
Expand Down Expand Up @@ -65,7 +65,7 @@ invoices with a DOCTYPE or external entities before Saxon runs.
**Downstream consumer**, frozen on a release commit (SHA from the release notes):

```yaml
- uses: facturxapi/validate-einvoice@172c8b824316f94459741e4cb9f1f348eb052a02 # v1.2.0
- uses: facturxapi/validate-einvoice@<full-commit-sha> # v1.3.0
with:
files: invoices/**/*.xml
```
Expand All @@ -82,8 +82,8 @@ Copy-paste workflow: [`examples/validate-invoices.yml`](examples/validate-invoic

## Which FacturX repo should I use?

- [validate-einvoice](https://github.com/facturxapi/validate-einvoice) — GitHub Action that runs the official ConnectingEurope EN16931 XSLT artefacts (CII/UBL): 1.3.16 by default, 1.3.17 opt-in.
- [en16931-oracles](https://github.com/facturxapi/en16931-oracles) — Replayable fixtures, receipts and mutants for EN16931 1.3.17, plus a BR-FR pack for the French Flux2 rules (tested on France_RFE `v1.4.0.02` / `v1.4.0.03`).
- [validate-einvoice](https://github.com/facturxapi/validate-einvoice) — GitHub Action that runs the official ConnectingEurope EN 16931 1.3.17 XSLT artefacts (CII/UBL).
- [en16931-oracles](https://github.com/facturxapi/en16931-oracles) — Replayable fixtures, receipts and mutants for EN 16931 1.3.17, plus a BR-FR pack for the French Flux2 rules (tested on France_RFE `v1.4.0.02` / `v1.4.0.03`).
- [awesome-einvoicing](https://github.com/facturxapi/awesome-einvoicing) — Sourced map of specs, validators, libraries and corpora. Inclusion is not a ranking.

## Public self-test (24 Aug 2026)
Expand Down Expand Up @@ -111,16 +111,16 @@ When this repository is checked out as the workflow repo (or vendored):

```yaml
# Frozen — full commit SHA of a release
- uses: facturxapi/validate-einvoice@172c8b824316f94459741e4cb9f1f348eb052a02 # v1.2.0
- uses: facturxapi/validate-einvoice@<full-commit-sha> # v1.3.0
with:
files: invoices/**/*.xml
fail-on: failed-assert

# Opt in to EN16931 1.3.17 (in force from 15/11/26)
# Previous rules — EN 16931 1.3.16 on the current release
- uses: facturxapi/validate-einvoice@v1
with:
files: invoices/**/*.xml
version: '1.3.17'
version: '1.3.16'

# Mutable — @v1 major tag (follows the latest v1.x.y)
- uses: facturxapi/validate-einvoice@v1
Expand Down Expand Up @@ -148,7 +148,7 @@ When this repository is checked out as the workflow repo (or vendored):
| `files` | yes | — | Glob(s) of XML invoices, relative to the workspace. Separate several globs with a newline or a comma. Zero matches fail the job (exit 2). |
| `syntax` | no | `auto` | `auto` reads the document-element namespace. `cii` / `ubl` force one syntax and fail if the document does not match. |
| `fail-on` | no | `failed-assert` | `failed-assert`: any `svrl:failed-assert` fails the job. `never`: report only. Comma-separated ids: fail only if one of those ids fires. An id renamed between 1.3.16 and 1.3.17 is translated with a warning; an id the selected XSLT does not contain under either name is a configuration error (exit 2). |
| `version` | no | `1.3.16` | `1.3.16` or `1.3.17` (opt-in until it takes effect on 15/11/26), the two vendored releases. Any other value is a configuration error. |
| `version` | no | `1.3.17` | `1.3.17` or `1.3.16`, the two vendored releases. Any other value is a configuration error. |

## Outputs

Expand All @@ -174,10 +174,10 @@ A different stylesheet is a different oracle; pins are not auto-updated.

| Version | Syntax | Vendored file | SHA256 |
|---|---|---|---|
| 1.3.17 (opt-in) | CII | `vendor/en16931-1.3.17/xslt/EN16931-CII-validation.xslt` | `0757f07909938b1b297b8356ab7b66406c89f1b342325385d6a2def998c817f0` |
| 1.3.17 (opt-in) | UBL | `vendor/en16931-1.3.17/xslt/EN16931-UBL-validation.xslt` | `fc4e6cfa8596bba0c2abd19038a98960c6ee9fc1f44566787c115efd4f4aca7c` |
| 1.3.16 (default) | CII | `vendor/en16931-1.3.16/xslt/EN16931-CII-validation.xslt` | `0b234dea2bbfee739b7761e607a992c17fab88773014ef56355b6158cfb1cc53` |
| 1.3.16 (default) | UBL | `vendor/en16931-1.3.16/xslt/EN16931-UBL-validation.xslt` | `39f9d282867f1a49e7708d9e29a53da89643e1ee56f10cec1ebcf1277595fcbd` |
| 1.3.17 (default) | CII | `vendor/en16931-1.3.17/xslt/EN16931-CII-validation.xslt` | `0757f07909938b1b297b8356ab7b66406c89f1b342325385d6a2def998c817f0` |
| 1.3.17 (default) | UBL | `vendor/en16931-1.3.17/xslt/EN16931-UBL-validation.xslt` | `fc4e6cfa8596bba0c2abd19038a98960c6ee9fc1f44566787c115efd4f4aca7c` |
| 1.3.16 | CII | `vendor/en16931-1.3.16/xslt/EN16931-CII-validation.xslt` | `0b234dea2bbfee739b7761e607a992c17fab88773014ef56355b6158cfb1cc53` |
| 1.3.16 | UBL | `vendor/en16931-1.3.16/xslt/EN16931-UBL-validation.xslt` | `39f9d282867f1a49e7708d9e29a53da89643e1ee56f10cec1ebcf1277595fcbd` |

Source of those octets: ConnectingEurope `eInvoicing-EN16931` tags
[`validation-1.3.17`](https://github.com/ConnectingEurope/eInvoicing-EN16931/releases/tag/validation-1.3.17)
Expand Down Expand Up @@ -219,22 +219,22 @@ unit tests, and run the identity gate. Any difference is a failure.
## What this does not claim

- Not a national CIUS (France, XRechnung profile, Peppol BIS, …).
`XRechnung-O.xml` is an official EN16931 category-O example, not a
`XRechnung-O.xml` is an official EN 16931 category-O example, not a
CIUS proof.
- Not Factur-X / ZUGFeRD packaging, not PDF/A-3, not veraPDF.
- Not a certification and not a product benchmark.
- Not an official ConnectingEurope Action. It only runs the official
ConnectingEurope EN16931 XSLT artefacts (1.3.16, 1.3.17).
ConnectingEurope EN 16931 XSLT artefacts (1.3.17, 1.3.16).

## Licence

EUPL 1.2 for this Action. The vendored XSLT (`validation-1.3.17` and
`validation-1.3.16`) and the official examples (`validation-1.3.17`) are
ConnectingEurope EN16931 artefacts, also EUPL 1.2, unmodified. Mutants are modified copies (see `NOTICE`).
ConnectingEurope EN 16931 artefacts, also EUPL 1.2, unmodified. Mutants are modified copies (see `NOTICE`).

## See also

- [awesome-einvoicing](https://github.com/facturxapi/awesome-einvoicing) — sourced map of EN16931 / Factur-X / ZUGFeRD / XRechnung specs, validators, and corpora.
- [awesome-einvoicing](https://github.com/facturxapi/awesome-einvoicing) — sourced map of EN 16931 / Factur-X / ZUGFeRD / XRechnung specs, validators, and corpora.
- [en16931-oracles](https://github.com/facturxapi/en16931-oracles) — test invoices with signed expected verdicts, aligned with the Commission's ITB validator (16/16). Useful as CI fixtures for this Action.
- For PDF/A-3 (Factur-X/ZUGFeRD) container checks, repair, and the French CTC profile: [facturxapi.com/docs](https://facturxapi.com/docs).
- Walkthrough: adding the official 1.3.16 XSLT to GitHub Actions (YAML, BR-* codes, fixtures that must fail): https://facturxapi.com/blog/valider-ci-github-actions
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

| Release line | Supported | Hardening controls below |
|---|---|---|
| `v1` major tag (**mutable**, points at `v1.2.0`) | yes | **yes** |
| `v1.1.1`, `v1.1.2`, `v1.2.0` | yes | **yes** |
| `v1` major tag (**mutable**, points at `v1.3.0`) | yes | **yes** |
| `v1.1.1`, `v1.1.2`, `v1.2.0`, `v1.3.0` | yes | **yes** |
| `v1.0.0`, `v1.1.0` | no — move to `v1` or the latest `v1.x.y` | **no** |
| `main` | development only | checked on every push |

Expand Down
12 changes: 6 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Validate EN16931 e-invoice'
description: >-
Official EN16931 XSLT (1.3.16 by default, 1.3.17 opt-in) on Factur-X /
ZUGFeRD CII and UBL XML; fails on svrl:failed-assert.
Official EN 16931 XSLT (1.3.17 by default, 1.3.16 opt-in) on
Factur-X/ZUGFeRD CII and UBL XML; fails on svrl:failed-assert.
author: 'euphyra-dev'

branding:
Expand Down Expand Up @@ -30,11 +30,11 @@ inputs:
default: 'failed-assert'
version:
description: >-
EN16931 XSLT version: 1.3.16 (default) or 1.3.17 (opt-in until it
takes effect on 15/11/26). Only these vendored, unmodified
ConnectingEurope artefacts are shipped.
EN16931 XSLT version: 1.3.17 (default, in force since 15/11/26) or
1.3.16. Only these vendored, unmodified ConnectingEurope artefacts
are shipped.
required: false
default: '1.3.16'
default: '1.3.17'

outputs:
verdict:
Expand Down
2 changes: 1 addition & 1 deletion docs/RELEASE_AND_RULESET.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This document describes the **expected** GitHub settings for `facturxapi/validat

| Artifact | Policy |
|---|---|
| Marketplace major tag `v1` | **Mutable** convenience channel, moved to each new `v1.x.y`. It points at `v1.2.0` (EN16931 1.3.16 by default, 1.3.17 opt-in). |
| Marketplace major tag `v1` | **Mutable** convenience channel, moved to each new `v1.x.y`. It points at `v1.3.0` (EN16931 1.3.17 by default). |
| Patch tags `v1.x.y` | Immutable once published; never force-move. Release notes name the tagged commit SHA. |
| `main` | Integration branch; must pass all CI gates before tag cut. |

Expand Down
4 changes: 2 additions & 2 deletions examples/validate-invoices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#
# Downstream consumers: pin `facturxapi/validate-einvoice@<40-char-sha>` from the
# release notes. The moving `@v1` tag is a mutable convenience channel that
# follows the latest v1.x.y. The default rules are EN16931 1.3.16; set
# `version: '1.3.17'` to opt in before 1.3.17 takes effect on 15/11/26.
# follows the latest v1.x.y. The default rules are EN16931 1.3.17; set
# `version: '1.3.16'` to keep the previous rules.

name: Validate EN16931 invoices

Expand Down
6 changes: 3 additions & 3 deletions src/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from pathlib import Path
from typing import Any, Iterator

DEFAULT_VERSION = "1.3.16"
DEFAULT_VERSION = "1.3.17"
ENGINE_NAME = "SaxonC-HE 13.0"
ENGINE_PKG_PIN = "saxonche==13.0.0"
ENGINE_PKG_PREFIX = "13.0"
Expand All @@ -41,8 +41,8 @@

# Vendored ConnectingEurope releases, unmodified: (path, SHA256) per syntax.
# The default is the release in force (the Commission registry lists 1.3.17
# as effective from 15/11/26); a newer one is selectable before that date and
# older ones stay selectable so a pinned `version:` keeps its rules.
# as effective from 15/11/26); older ones stay selectable so a pinned
# `version:` keeps its rules.
VENDORED_XSLT: dict[str, dict[str, tuple[str, str]]] = {
"1.3.17": {
"CII": (
Expand Down
8 changes: 4 additions & 4 deletions supply-chain/tree.sha256
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
d1fd7b08d42a8646f0957cc4d11bd8e12ec988a64e4373ebe3df152a6e929959 .github/workflows/selftest.yml
4fc0db0a2924b8d652e3b6c470afa221826ebf70ce5619694da135eda7bf2043 .github/workflows/supply-chain.yml
2579e8013e09725f5e2fe8bbe52e7a2affda62c574cad7a227757a41f9885c76 .github/workflows/upstream-drift.yml
fc1787bfc30d6515629905aec97d6c9640ffe3289fcf91033b9e897e743abbe3 SECURITY.md
3201a816d0bd6d94cd34378100b5243b62fa5dcec98c1ee368c8bacd58146bfb action.yml
6d75f3ff3cc728bb45641f62b70235205553971114b445b271dd06621cd54c0f docs/RELEASE_AND_RULESET.md
919bd6c529562c7429c5908a38519a6fa6b6b714d187a39541d70708aab6b1c5 examples/validate-invoices.yml
39ff37fc4112d281503c9d275c28a719288d7a0e0019214784721276407d665d SECURITY.md
fe2ba612a44e5d9b4a5b539642d3c041532cbb872546cccbf6e208593acbf24a action.yml
6462d166aff47764c0c48b5cccd41cc2a351636f835292868a02dcc9a8c83d86 docs/RELEASE_AND_RULESET.md
2aea169eaa84fe3984d65db8d01aaeebfd8f4ff34aa531b0466dc57f5dbc4bf8 examples/validate-invoices.yml
edb6cbad1392b557221ec706c3348aa62cc8e9a95b6eff9e8852c4df209acb24 requirements.lock
541d1b0f2bc68aedb17c6adae7188117643cefe0e719c4b113ece67df4b7e035 requirements.txt
c473a9139b9beb7686fa5bfd6212e6e074ea45024bfe61472d0aaf529f38586e scripts/check_supply_chain.py
Expand Down
6 changes: 3 additions & 3 deletions tests/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ def test_vendored_sha256(self) -> None:
self.assertEqual(mapping[syntax]["logical"], logical)

def test_default_is_the_release_in_force(self) -> None:
# 1.3.17 is effective from 15/11/26 (Commission registry): opt-in until then.
self.assertEqual(validate.DEFAULT_VERSION, "1.3.16")
self.assertIn("1.3.17", validate.VENDORED_XSLT)
# 1.3.17 is effective from 15/11/26 (Commission registry).
self.assertEqual(validate.DEFAULT_VERSION, "1.3.17")
self.assertIn("1.3.16", validate.VENDORED_XSLT)

def test_upstream_pin_is_newest_vendored(self) -> None:
pins = json.loads((ROOT / "vendor" / "upstream.json").read_text(encoding="utf-8"))
Expand Down
Loading