From 9ad3dcda2f9ee1d06241ee6e348cdace1d7acdec Mon Sep 17 00:00:00 2001 From: jonasbn Date: Fri, 19 Jul 2024 07:56:48 +0200 Subject: [PATCH] Attempting to outline some more guardrails for myself, untested at this time --- scripts/build.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/build.pl b/scripts/build.pl index 6226dbdd..3287836b 100755 --- a/scripts/build.pl +++ b/scripts/build.pl @@ -11,6 +11,25 @@ die 'Usage build.pl '; } +if (not -f 'Dockerfile') { + die 'No Dockerfile found'; +} + +if (not -f 'gh') { + die 'No gh found'; +} + +if (not -f 'action.yml') { + die 'No action.yml found'; +} + +open my $fh, '<', 'action.yml'; +my $action_yml = do { local $/; <$fh> }; +if ($action_yml !~ m/docker:\/\/jonasbn\/github-action-spellcheck:$version/) { + die "Version in action.yml does not match: $version"; +} +close $fh; + say "Building Docker images for version: $version"; my @targets = qw(v0 latest);