Skip to content

Commit

Permalink
Fail the update-otp-patches workflow is string replacement fails
Browse files Browse the repository at this point in the history
  • Loading branch information
HoloRin committed Oct 4, 2022
1 parent 1843d79 commit cc75747
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/update-otp-patches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,27 +83,29 @@ jobs:
let source = await readFile(s, 'utf-8');
let pattern = await readFile(p, 'utf-8');
let replacement = await readFile(r, 'utf-8');
if (!source.includes(pattern)) process.exit(1);
let updated = source.replace(pattern, replacement);
await writeFile(s, updated);
EOF
cat << EOF > old.txt
internal_erlang_from_http_archive(
internal_erlang_from_github_release(
name = "${{ matrix.name }}",
sha256 = "${OLD_SHA}",
version = "${OLD_VERSION}",
),
EOF
cat << EOF > new.txt
internal_erlang_from_http_archive(
internal_erlang_from_github_release(
name = "${{ matrix.name }}",
sha256 = "${{ steps.fetch-version.outputs.SHA }}",
version = "${{ steps.fetch-version.outputs.VERSION }}",
),
EOF
node replacer.mjs WORKSPACE old.txt new.txt
rm replacer.mjs old.txt new.txt
set -x
git diff
Expand Down

0 comments on commit cc75747

Please sign in to comment.