Skip to content

Commit cc75747

Browse files
committed
Fail the update-otp-patches workflow is string replacement fails
1 parent 1843d79 commit cc75747

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/update-otp-patches.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,27 +83,29 @@ jobs:
8383
let source = await readFile(s, 'utf-8');
8484
let pattern = await readFile(p, 'utf-8');
8585
let replacement = await readFile(r, 'utf-8');
86+
if (!source.includes(pattern)) process.exit(1);
8687
let updated = source.replace(pattern, replacement);
8788
await writeFile(s, updated);
8889
EOF
8990
9091
cat << EOF > old.txt
91-
internal_erlang_from_http_archive(
92+
internal_erlang_from_github_release(
9293
name = "${{ matrix.name }}",
9394
sha256 = "${OLD_SHA}",
9495
version = "${OLD_VERSION}",
9596
),
9697
EOF
9798
9899
cat << EOF > new.txt
99-
internal_erlang_from_http_archive(
100+
internal_erlang_from_github_release(
100101
name = "${{ matrix.name }}",
101102
sha256 = "${{ steps.fetch-version.outputs.SHA }}",
102103
version = "${{ steps.fetch-version.outputs.VERSION }}",
103104
),
104105
EOF
105106
106107
node replacer.mjs WORKSPACE old.txt new.txt
108+
rm replacer.mjs old.txt new.txt
107109
108110
set -x
109111
git diff

0 commit comments

Comments
 (0)