-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BAH-1386 | Added trigger to openmrs-distro-bahmni
Co-authored-by: Soorya Kumaran C<[email protected]>
- Loading branch information
1 parent
35d2df5
commit 8ffb362
Showing
2 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters