Skip to content

Invalid group #299

@volker-raschek

Description

@volker-raschek

Hey,
I use your action to validate the pull requests. The following regexp is defined as headerPattern: ^(?:\[[A-Z]*-\d* \/fixed\] )?(?<type>\w*)(?:\((?<scope>[\w$.\-*\/ ]*)\))?: (?<subject>(?:.(?!(?i)\/fixed))*)$. The action throws an issue, the the group is invalid.

Image

I tested the regexp on regexp101 and seems to be valid, but the actions throws that issue. Can anyone explain, why the action is throwing this issue or how I can improve the action configuration?

name: "Lint PR"

on:
  pull_request_target:
    types:
    - opened
    - edited
    - reopened

jobs:
  main:
    name: "Validate PR title"
    runs-on: docker
    permissions:
      pull-requests: read
    steps:
    - env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        # Conventional Commits: https://www.conventionalcommits.org/en/v1.0.0/
        # RegExp101:            https://regex101.com/r/PWba2g
        #
        # Examples:
        # fix(backend): adapt /u/qu-seed/resources/internal/examples
        # docs(README): add missing documentation about environment variables
        # [HDEFECT-1234 /fixed] fix(backend): adapt /u/qu-seed/resources/internal/examples
        # [HDEFECT-1234 /fixed] docs(README): add missing documentation about environment variables
        headerPattern: '^(?:\[[A-Z]*-\d* \/fixed\] )?(?<type>\w*)(?:\((?<scope>[\w$.\-*\/ ]*)\))?: (?<subject>(?:.(?!(?i)\/fixed))*)$'
        headerPatternCorrespondence: type, scope, subject

        # Configure which scopes are allowed (newline-delimited).
        # These are regex patterns auto-wrapped in `^ $`.
        # scopes: |
        #   core
        #   ui
        #   JIRA-\d+

        # Ensure, that a scope is present
        requireScope: true

      uses: amannn/action-semantic-pull-request@v6.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions