name: E-Invoicing API invoice check description: Validate generated e-invoices with the official EN 16931, XRechnung, Peppol, Factur-X, Facturae and KSeF rules author: E-Invoicing API (einvoiceengine.com) branding: icon: check-square color: blue inputs: folder: description: Folder with generated invoices (XML or ZUGFeRD / Factur-X PDF); not needed with test-set required: false default: "" test-set: description: Id of a test set stored in your account; runs it on the server (expectations and run history are kept there) instead of checking a folder default: "" rules: description: Rule set version to pin (e.g. 2026-11), or latest default: latest baseline: description: Baseline file; when present only new failures fail the build default: "" compare-rules: description: Also validate with this rule set and list files whose result changes default: "" comment: description: Post the summary as a pull request comment (needs pull-requests write permission) default: "true" base-url: description: API address default: https://einvoiceengine.com outputs: exit-code: description: 0 when every invoice passed (no new failures against the baseline; with test-set, every document matched its expected result), 1 otherwise value: ${{ steps.check.outputs.exit }} runs: using: composite steps: - name: Validate invoices id: check shell: bash env: EINV_BASE: ${{ inputs.base-url }} IN_FOLDER: ${{ inputs.folder }} IN_RULES: ${{ inputs.rules }} IN_BASELINE: ${{ inputs.baseline }} IN_COMPARE: ${{ inputs.compare-rules }} IN_TEST_SET: ${{ inputs.test-set }} ACTION_DIR: ${{ github.action_path }} run: | set +e extra=() [ -n "$IN_COMPARE" ] && extra+=(--compare-rules "$IN_COMPARE") if [ -n "$IN_TEST_SET" ]; then node "$ACTION_DIR/einv-ci.mjs" --test-set "$IN_TEST_SET" --rules "$IN_RULES" \ --summary "$RUNNER_TEMP/einv-summary.md" --report "$RUNNER_TEMP/einv-report.json" "${extra[@]}" else [ -n "$IN_BASELINE" ] && extra+=(--baseline "$IN_BASELINE") node "$ACTION_DIR/einv-ci.mjs" "$IN_FOLDER" --rules "$IN_RULES" \ --summary "$RUNNER_TEMP/einv-summary.md" --report "$RUNNER_TEMP/einv-report.json" "${extra[@]}" fi code=$? cat "$RUNNER_TEMP/einv-summary.md" >> "$GITHUB_STEP_SUMMARY" echo "exit=$code" >> "$GITHUB_OUTPUT" - name: Comment on the pull request if: ${{ inputs.comment == 'true' && github.event_name == 'pull_request' }} shell: bash env: GH_TOKEN: ${{ github.token }} PR: ${{ github.event.pull_request.number }} run: gh pr comment "$PR" --body-file "$RUNNER_TEMP/einv-summary.md" --edit-last || gh pr comment "$PR" --body-file "$RUNNER_TEMP/einv-summary.md" || true - name: Fail on new errors shell: bash env: CODE: ${{ steps.check.outputs.exit }} run: exit "$CODE"