From 18674706b1a9a635830a87b8282090769766cd88 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Thu, 9 Jan 2025 15:24:53 -0300 Subject: [PATCH] Remove yq dependency from workflow setup - Remove redundant "Install yq" step from the workflow. Related to #315 --- patches/RemoveYq.java | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 patches/RemoveYq.java diff --git a/patches/RemoveYq.java b/patches/RemoveYq.java new file mode 100644 index 0000000..d01c687 --- /dev/null +++ b/patches/RemoveYq.java @@ -0,0 +1,28 @@ +///usr/bin/env jbang "$0" "$@" ; exit $? + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.OptionalInt; +import java.util.stream.IntStream; + +/** + * Remove the Install YQ step from the quarkus-snapshot.yaml workflow and update actions + */ +public class RemoveYq { + + public static void main(String... args) throws Exception { + Path workflowFile = Path.of(".github/workflows/quarkus-snapshot.yaml"); + if (Files.exists(workflowFile)) { + String fileContents = Files.readString(workflowFile, StandardCharsets.UTF_8); + fileContents = fileContents.replace(""" + - name: Install yq + run: sudo add-apt-repository ppa:rmescandon/yq && sudo apt update && sudo apt install yq -y + +""", ""); + Files.writeString(workflowFile, fileContents); + } + } + +}