From 666ff85f39cc88dd9f6817ad629f19e0eb1a81ef Mon Sep 17 00:00:00 2001 From: deepaktiwari Date: Fri, 20 Dec 2024 20:07:47 +0530 Subject: [PATCH 1/3] added workflow file --- .github/workflows/sampleworkflow.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/sampleworkflow.yml diff --git a/.github/workflows/sampleworkflow.yml b/.github/workflows/sampleworkflow.yml new file mode 100644 index 0000000..6a7a7ba --- /dev/null +++ b/.github/workflows/sampleworkflow.yml @@ -0,0 +1,19 @@ +name: Trigger playwright automation Workflow + +on: + pull_request: + branches: + - main # Replace with the branch name to monitor + +jobs: + trigger: + runs-on: ubuntu-latest + + steps: + - name: Trigger Repository A Workflow + run: | + curl -X POST \ + -H "Accept: application/vnd.github.everest-preview+json" \ + -H "Authorization: Bearer ${{ secrets.AUTOMATION_REPO_TOKEN }}" \ + https://api.github.com/repos/codeandtheory/playwright-automation-framework/dispatches \ + -d '{"event_type": "trigger-workflow"}' From 1b0e9fd3b7eb1b3046135e80469ea18bd9c2aa1c Mon Sep 17 00:00:00 2001 From: deepaktiwari Date: Wed, 22 Jan 2025 13:13:51 +0530 Subject: [PATCH 2/3] updated --- src/main/java/com/ct/framework/common/CommonUtil.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/ct/framework/common/CommonUtil.java b/src/main/java/com/ct/framework/common/CommonUtil.java index 32d318b..ae12166 100644 --- a/src/main/java/com/ct/framework/common/CommonUtil.java +++ b/src/main/java/com/ct/framework/common/CommonUtil.java @@ -261,7 +261,9 @@ public String getImageAsBase64(WebDriver driver, String screenshotName) throws E File finalDestination = new File(destination); FileUtils.copyFile(source, finalDestination); byte[] imageBytes= IOUtils.toByteArray(new FileInputStream(destination)); + System.out.println("Changes made to trigger workflow"); return Base64.getEncoder().encodeToString(imageBytes); + } public JSONArray readFileAsJSONArray(String resourceNameWithPath){ From 9ced5740d7e350bcddf571515a9cedfeb15c7103 Mon Sep 17 00:00:00 2001 From: deepaktiwari Date: Wed, 22 Jan 2025 13:19:26 +0530 Subject: [PATCH 3/3] updated --- src/main/java/com/ct/framework/common/CommonUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ct/framework/common/CommonUtil.java b/src/main/java/com/ct/framework/common/CommonUtil.java index ae12166..dba9f78 100644 --- a/src/main/java/com/ct/framework/common/CommonUtil.java +++ b/src/main/java/com/ct/framework/common/CommonUtil.java @@ -261,7 +261,7 @@ public String getImageAsBase64(WebDriver driver, String screenshotName) throws E File finalDestination = new File(destination); FileUtils.copyFile(source, finalDestination); byte[] imageBytes= IOUtils.toByteArray(new FileInputStream(destination)); - System.out.println("Changes made to trigger workflow"); + System.out.println("Changes made to trigger workflow..."); return Base64.getEncoder().encodeToString(imageBytes); }