Using commits instead of PR title #68
root-ansh-ct
started this conversation in
General
Replies: 2 comments 15 replies
|
Hey @root-ansh-ct As long as you don't set And also check how to debug the action here https://github.com/GsActions/commit-message-checker#troubleshooting-and-debugging. |
7 replies
|
hey @gilbertsoft , I think am very close to getting this to work. I checked the regex, this seems to pickup the first message correctly. however when running in the github action, it seems to give error, not sure why. I even enabled logging and here are the logs: 2022-03-22T09:26:59.2416093Z ##[debug]Evaluating condition for step: 'validate commit format -- Check if HEAD commit message contains [xyz] or FAIL'
2022-03-22T09:26:59.2420233Z ##[debug]Evaluating: success()
2022-03-22T09:26:59.2420804Z ##[debug]Evaluating success:
2022-03-22T09:26:59.2421565Z ##[debug]=> true
2022-03-22T09:26:59.2422228Z ##[debug]Result: true
2022-03-22T09:26:59.2424012Z ##[debug]Starting: validate commit format -- Check if HEAD commit message contains [xyz] or FAIL
2022-03-22T09:26:59.2457298Z ##[debug]Loading inputs
2022-03-22T09:26:59.2500171Z ##[debug]Evaluating: secrets.GITHUB_TOKEN
2022-03-22T09:26:59.2500602Z ##[debug]Evaluating Index:
2022-03-22T09:26:59.2500950Z ##[debug]..Evaluating secrets:
2022-03-22T09:26:59.2501330Z ##[debug]..=> Object
2022-03-22T09:26:59.2501674Z ##[debug]..Evaluating String:
2022-03-22T09:26:59.2502326Z ##[debug]..=> 'GITHUB_TOKEN'
2022-03-22T09:26:59.2503540Z ##[debug]=> '***'
2022-03-22T09:26:59.2504052Z ##[debug]Result: '***'
2022-03-22T09:26:59.2516898Z ##[debug]Loading env
2022-03-22T09:26:59.2524613Z ##[group]Run gsactions/commit-message-checker@v1
2022-03-22T09:26:59.2525098Z with:
2022-03-22T09:26:59.2525360Z excludeDescription: true
2022-03-22T09:26:59.2525636Z excludeTitle: true
2022-03-22T09:26:59.2526029Z pattern: ^\[[^]]+\].+
2022-03-22T09:26:59.2526449Z flags: g
2022-03-22T09:26:59.2526767Z error: Your head commit must contain `[..]` like "[BUGFIX] or [SDK-974]".
2022-03-22T09:26:59.2527283Z checkAllCommitMessages: true
2022-03-22T09:26:59.2527828Z accessToken: ***
2022-03-22T09:26:59.2528079Z ##[endgroup]
2022-03-22T09:26:59.3521843Z ##[debug]Get inputs...
2022-03-22T09:26:59.3528466Z ##[debug]pattern: ^\[[^]]+\].+
2022-03-22T09:26:59.3530613Z ##[debug]flags: g
2022-03-22T09:26:59.3532515Z ##[debug]error: Your head commit must contain `[..]` like "[BUGFIX] or [SDK-974]".
2022-03-22T09:26:59.3533489Z ##[debug]excludeTitle: true
2022-03-22T09:26:59.3534633Z ##[debug]excludeDescription: true
2022-03-22T09:26:59.3535838Z ##[debug]checkAllCommitMessages: true
2022-03-22T09:26:59.3537655Z ##[debug]accessToken: ***
2022-03-22T09:26:59.3538519Z ##[debug]Get messages...
2022-03-22T09:26:59.3540001Z ##[debug] - pullRequestOptions: {
2022-03-22T09:26:59.3540440Z ##[debug] "ignoreTitle": true,
2022-03-22T09:26:59.3540734Z ##[debug] "ignoreDescription": true,
2022-03-22T09:26:59.3541046Z ##[debug] "checkAllCommitMessages": true,
2022-03-22T09:26:59.3541530Z ##[debug] "accessToken": "***"
2022-03-22T09:26:59.3541784Z ##[debug]}
2022-03-22T09:26:59.3542708Z ##[debug] - eventName: push
2022-03-22T09:26:59.3543985Z Checking commit messages against "^\[[^]]+\].+"...
2022-03-22T09:26:59.3544711Z - failed: "[CHECK] support commit checks for blocks"
2022-03-22T09:26:59.3574720Z ##[error]Error: Your head commit must contain `[..]` like "[BUGFIX] or [SDK-974]".
2022-03-22T09:26:59.3622836Z ##[debug]Node Action run completed with exit code 1
2022-03-22T09:26:59.3631887Z ##[debug]Finishing: validate commit format -- Check if HEAD commit message contains [xyz] or FAILis it unable to receive the github token secret? I tried creating a secret with key |
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
Code of Conduct
Is there an existing issue for this?
GitHub-hosted runner
ubuntu-latest
Additional runner information
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/1Steps 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
All reactions