diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a799c34 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: Continuous Integration +on: + # workflow_run: + # workflows: [Build and generate artifacts for openmrs-module-episodes] + # types: + # - completed + push: + branches: + - master + - BAH-* + + +env: + ORG_NAME: Bahmni + EVENT_TYPE: openmrs-module-episodes-trigger +jobs: + demo: + name: Trigger Workflows + runs-on: ubuntu-latest + # if: ${{ github.event.workflow_run.conclusion == 'success' }} + strategy: + matrix: + dependent-repos: ["openmrs-distro-bahmni"] + steps: + - name: Create repository_dispatch + env: + REPOSITORY_NAME: ${{ matrix.dependent-repos }} + run : | + trigger_result=$(curl -s -o trigger_response.txt -w "%{http_code}" -X POST -H "Accept: application/vnd.github.v3+json" -H 'authorization: Bearer ${{ secrets.WORKFLOW_TRIGGER_TOKEN }}' https://api.github.com/repos/${ORG_NAME}/${REPOSITORY_NAME}/dispatches -d '{"event_type":"'"${EVENT_TYPE}"'"}') + if [ $trigger_result == 204 ];then + echo "Trigger to $ORG_NAME/$REPOSITORY_NAME Success" + else + echo "Trigger to $ORG_NAME/$REPOSITORY_NAME Failed" + cat trigger_response.txt + exit 1 + fi \ No newline at end of file diff --git a/pom.xml b/pom.xml index 9d0a0be..7556685 100644 --- a/pom.xml +++ b/pom.xml @@ -30,13 +30,13 @@ 1.10.19 - + github