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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,557,199
Community Members
 
Community Events
184
Community Groups

Scriptrunner for Bitbucket: Check file content in commit

Edited

I am trying to create a script to be able to check if certain files that are committed contain a tab character in the file. I have gotten the code to successfully block commits/pushes if the file name matches, but now that I am trying to dig into the content I continue to get a "path not found error. 

Edit: Issue resolved 

4 answers

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.
Jan 19, 2022

Hi @Juan Maraboli , @mark-1003 and @Sascha SK ,

Further to my previous answer, 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

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.
Nov 26, 2021 • edited

Hi @Juan Maraboli , @mark-1003 , @Sascha SK ,

Thank you for your questions regarding this.

In ScriptRunner for Bitbucket we have an example Snippet showing how to load the contents of a JSON file.

The Snippet can be found on the Snippets of the Protect Git Refs pre-hook: https://docs.adaptavist.com/sr4bib/latest/features/script-pre-receive-hooks/built-in-pre-receive-hooks/protect-git-refs

We are also planning to make examples around file reading more accessible to users, as currently it only exists as a Snippet example from within the product itself.

Please let me know if this helps solve what you wanted to achieve?

Kind regards,

Robert Giddings

I would also be interested in the resolution... would be nice if You could share it!

Hi @Juan Maraboli ,

I have a similar problem to solve. Would you mind sharing your solution with me/us?

Thanks a lot and best regards
Sascha

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events