Skip to content

regex not matching head commit but rather the PR title #67

Closed

Description

@root-ansh-ct

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

GitHub-hosted runner

ubuntu-latest

Additional runner information

      - name: validate commit format -- Check if HEAD commit message contains [xyz] or FAIL.
        uses: gsactions/commit-message-checker@v1
        with:
          pattern: '\[[^]]+\]'
          flags: 'gm'
          error: 'Your  commit must contain `[..]` like "[BUGFIX] or [SDK-974]".'
          #checkAllCommitMessages: 'false' # optional: this checks all commits associated with a pull request
          #accessToken: ${{ secrets.GITHUB_TOKEN }} # github access token is only required if checkAllCommitMessages is true

          #pattern: '^[^#].{74}'     error: 'The maximum line length of 74 characters is exceeded.'
          #excludeDescription: 'true' # optional: this excludes the description body of a pull request
          #excludeTitle: 'true' # optional: this excludes the title of a pull request
          #pattern: '^.+(Resolves|Fixes): \#[0-9]+$' #  Check for Resolves / Fixes

Current Behavior

The above mentioned yaml is not working on head commit but rather the PR title. i wish to check on just the head commit and not enforce namings on PR title/ description

Expected Behavior

expected the regex '\[[^]]+\]' to match for commit [FIX] [SDK-974] validate head commit format (should be successful) , but not sure why it isn't matching . on regex101 site, it seems to work correctly. : https://regex101.com/r/VapGyU/1

Steps To Reproduce

run the above yaml mentioned in any github runner and you will find the title getting validated but not the head commit

Anything else?

https://github.com/CleverTap/clevertap-android-sdk/actions/runs/2014762191

Activity

  1. gilbertsoft commented on Mar 21, 2022

    @gilbertsoft
    Member

    Hey @root-ansh-ct

    As long as you don't set checkAllCommitMessages to true only the PR tile and description are used as written here https://github.com/GsActions/commit-message-checker#configuration.

    And also check how to debug the action here https://github.com/GsActions/commit-message-checker#troubleshooting-and-debugging.

  2. locked and limited conversation to collaborators on Mar 21, 2022
  3. converted this issue into a discussion #68 on Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions