summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorRin Kuryloski <kuryloskip@vmware.com>2022-10-04 09:51:14 +0200
committerRin Kuryloski <kuryloskip@vmware.com>2022-10-04 09:51:14 +0200
commitf757d2f94b287f575584ff6fd9709eb66c62f3fc (patch)
tree5a652cf90cb4899dd74500ec96f0bb65b465b50c /.github
parentb31f23c4d0560a4a6480e103bb06f7347b729c03 (diff)
downloadrabbitmq-server-git-f757d2f94b287f575584ff6fd9709eb66c62f3fc.tar.gz
Fixup the update-otp-patches.yaml workflow
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/update-otp-patches.yaml29
1 files changed, 26 insertions, 3 deletions
diff --git a/.github/workflows/update-otp-patches.yaml b/.github/workflows/update-otp-patches.yaml
index ec8a4e044c..cd37218719 100644
--- a/.github/workflows/update-otp-patches.yaml
+++ b/.github/workflows/update-otp-patches.yaml
@@ -77,9 +77,32 @@ jobs:
echo "$(cat WORKSPACE | buildozer 'set urls ["https://github.com/erlang/otp/archive/OTP-${{ steps.fetch-version.outputs.VERSION }}.tar.gz"]' -:otp_src_${{ matrix.name }})" > WORKSPACE
echo "$(cat WORKSPACE | buildozer 'set sha256 "${{ steps.fetch-version.outputs.SHA2 }}"' -:otp_src_${{ matrix.name }})" > WORKSPACE
- sed -i"_orig" "s/${OLD_SHA}/${{ steps.fetch-version.outputs.SHA }}/" WORKSPACE
- sed -i"_orig" "s/${OLD_VERSION}/${{ steps.fetch-version.outputs.VERSION }}/" WORKSPACE
- rm *_orig
+ cat << EOF > replacer.js
+ import { readFile } from 'node:fs/promises';
+ let [_node, _script, s, p, r] = process.argv;
+ let source = await readFile(s, 'utf-8');
+ let pattern = await readFile(p, 'utf-8');
+ let replacement = await readFile(r, 'utf-8');
+ console.log(source.replace(pattern, replacement));
+ EOF
+
+ cat << EOF > old.txt
+ internal_erlang_from_http_archive(
+ name = "${{ matrix.name }}",
+ sha256 = "${OLD_SHA}",
+ version = "${OLD_VERSION}",
+ ),
+ EOF
+
+ cat << EOF > new.txt
+ internal_erlang_from_http_archive(
+ name = "${{ matrix.name }}",
+ sha256 = "${{ steps.fetch-version.outputs.SHA }}",
+ version = "${{ steps.fetch-version.outputs.VERSION }}",
+ ),
+ EOF
+
+ node replacer.mjs WORKSPACE old.txt new.txt > WORKSPACE
set -x
git diff