From 3462f3cc94f13102aa32383128a2087a2ce83e87 Mon Sep 17 00:00:00 2001 From: sjshweta Date: Mon, 6 Mar 2023 11:57:40 +0530 Subject: [PATCH] Added support for vm-manager-ci Signed-off-by: sjshweta --- .github/workflows/pr-approved.yml | 34 +++++++++++++++++++++++++++++++ .github/workflows/pr-raised.yml | 29 ++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .github/workflows/pr-approved.yml create mode 100644 .github/workflows/pr-raised.yml diff --git a/.github/workflows/pr-approved.yml b/.github/workflows/pr-approved.yml new file mode 100644 index 0000000..1a18ece --- /dev/null +++ b/.github/workflows/pr-approved.yml @@ -0,0 +1,34 @@ +--- +name: Run VM-MANAGER-PR-MERGE-FLOW + +on: + pull_request_review: + types: [submitted] + branches: + - master + - tmp/ci-testing + +env: + EVENT_CONTEXT: ${{ toJSON(github.event) }} + BUILDTOKEN: test_issue + JENKINS_URL: https://cbjenkins-ba.devtools.intel.com/teams-satg-aee-android-ci/generic-webhook-trigger/invoke?token= + +jobs: + if_merged: + if: github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master' || github.event.pull_request.base.ref == 'tmp/ci-testing' + runs-on: self-hosted + steps: + - run: | + echo The PR was merged + - name: converting object to json + env: + EVENT_CONTEXT: ${{ toJSON(github.event) }} + run: | + echo "$EVENT_CONTEXT" + - name: Triggering Jenkins job + run: |- + curl --location --request POST ${{ env.JENKINS_URL }}${{ env.BUILDTOKEN }} \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "action": ${{ env.EVENT_CONTEXT }} + }' \ No newline at end of file diff --git a/.github/workflows/pr-raised.yml b/.github/workflows/pr-raised.yml new file mode 100644 index 0000000..2649989 --- /dev/null +++ b/.github/workflows/pr-raised.yml @@ -0,0 +1,29 @@ +--- +name: Run VM-MANAGER-PR-FLOW + +on: + pull_request: + types: [opened, synchronize, reopened, edited] + branches: "**" + +env: + EVENT_CONTEXT: ${{ toJSON(github.event) }} + BUILDTOKEN: test_vmmanager + JENKINS_URL: https://cbjenkins-ba.devtools.intel.com/teams-satg-aee-android-ci/generic-webhook-trigger/invoke?token= + +jobs: + Build: + runs-on: self-hosted + steps: + - name: converting object to json + env: + EVENT_CONTEXT: ${{ toJSON(github.event) }} + run: | + echo "$EVENT_CONTEXT" + - name: Triggering Jenkins job + run: |- + curl --location --request POST ${{ env.JENKINS_URL }}${{ env.BUILDTOKEN }} \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "action": ${{ env.EVENT_CONTEXT }} + }' \ No newline at end of file