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
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
ScriptRunner for Bitbucket
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?
Hi community 👋, Here is another monthly roundup of the partner-organized events in July 2022. If there is any event missing please let me know in the comments below 🙏 If you're looking for Atla...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events