cimpl 0.4.0

Simple C implementations from Rust - FFI utilities and macros for creating safe, ergonomic C bindings
Documentation
name: PR title

on:
  pull_request:
    types: [opened, synchronize, reopened, edited]

jobs:
  title_cc_validation:
    name: Conventional commits validation
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0

      # If changing this, please also see `.commitlintrc` and
      # `docs/release-process.md` (in contentauth/c2pa-rs repo).

      - name: Check PR title
        env:
          PR_TITLE: ${{ github.event.pull_request.title }}
        run: |
          # If this step fails, please expand this step for more information.
          #
          # You will need to revise this pull request's title to
          # match the "summary" (first) line of a Conventional Commit message.
          # This enables us to automatically generate a meaningful changelog.
          #
          # The summary line (and thus the PR title) must have this exact format
          # (including punctuation):
          #
          #     type: description
          #
          # `type` describes the nature of changes you are making. This project
          # requires the type to be one of these exact names:
          #
          #    * fix
          #    * feat (will cause a minor version bump)
          #    * chore (will be omitted from changelog)
          #    * update
          #    * doc
          #
          # NOTE: Conventional Commits also defines a `(scope)` parameter
          # which can define a sub-area within the project where the change was
          # made. This project is configured to disallow the use of `scope`.
          #
          # `description` is a short human-readable summary of the changes being made.
          # It is required.
          #
          # This project does not currently enforce the following items, but
          # we ask that you observe the following preferences in `description`:
          #
          #    * The entire description should be written and capitalized as
          #      an English-language sentence, except that the trailing period
          #      should be omitted.
          #    * Any acronyms such as JSON or YAML should be capitalized as per
          #      common usage in English-language sentences.
          #
          # After you edit the PR title, this task will run again and the
          # warning should go away if you have made acceptable changes.
          #
          # For more information on Conventional Commits, please see:
          #
          #    https://www.conventionalcommits.org/en/v1.0.0/
          #
          # ------------ (end of message) ------------

          if echo "$PR_TITLE" | grep -E '^chore(\(.*\))?: release '; then
            echo "Exception / OK: chore release pattern"
            exit 0;
          fi

          if echo "$PR_TITLE" | grep -E '^chore: release'; then
            echo "Exception / OK: chore release pattern"
            exit 0;
          fi

          if echo "$PR_TITLE" | grep -E '^chore(\(deps\))?: bump '; then
            echo "Exception / OK: Dependabot update pattern"
            exit 0;
          fi

          if echo "$PR_TITLE" | grep -E '^update: update '; then
            echo "Exception / OK: Dependabot update pattern"
            exit 0;
          fi

          if echo "$PR_TITLE" | grep -E '^update: bump '; then
            echo "Exception / OK: Dependabot update pattern"
            exit 0;
          fi

          echo "Installing commitlint-rs. Please wait 30-40 seconds ..."
          cargo install --quiet commitlint-rs
          set -e

          echo  
          echo  
          echo --- commitlint results for PR title \"$PR_TITLE\" ---
          echo  

          echo "$PR_TITLE" | commitlint -g .commitlintrc.yml

          echo "✅ PR title matches all enforced rules."