Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Do we have any possibility to create pre-commit with checking source code with Scriptrunner

Nike December 16, 2021

I need reject  commit if code contains some pattern.

For example:

def someMethod():
print("somePattern")

someMethod()

I need reject that commit becase it contains "somePattern" .

 

Can i do this?

1 answer

0 votes
Robert Giddings [Adaptavist]
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 21, 2021

Hi @Nikita Mesnyankin ,

Yes, we are looking into providing some examples, on how to do this. Which should be available some time in the New Year.

Kind regards,

Robert Giddings,

Product Manager, ScriptRunner for Bitbucket

Robert Giddings [Adaptavist]
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 19, 2022

Hi @Nike ,

We have now published a Script to our Adaptavist Library that shows an example of blocking commits based on file content.

The Script can be found here: https://library.adaptavist.com/entity/block-commits-for-files-containing-content-that-doesnt-match-regex

Kind regards,

Robert Giddings,

Product Manager,

ScriptRunner for Bitbucket

Nike January 26, 2022

Thanks)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events