package JSON::ReadPath;
$JSON::ReadPath::VERSION = '3.01';
use strict;
use warnings;
use JSON::XS qw( encode_json decode_json );
use Mouse;
use Template;
=head1 NAME
JSON::ReadPath - In Jenkins grep
payload json data and assign to an environment
variable.
=head1 USAGE
Let's say Bitbucket pushed a payload '{"commits":{ "branch": "FooBar" }}'
And we want to grab the branch name from the payload
.
BRANCH=$(read_json.pl --env payload --path commits.branch)
=cut
has file => (
is => "ro",
isa => "Str",
);
has string => (
is => "ro",
isa => "Str",
);
has config => (
is