Skip to content

Commit

Permalink
BAH-1305 | Refactor naming and PAT
Browse files Browse the repository at this point in the history
Co-authored-by: Arjun G <arjun.g@thoughtworks.com>
  • Loading branch information
SooryaKumaranC-tw and Arjun-Go committed Feb 22, 2022
1 parent d7407b0 commit fc49cf0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml → .github/workflows/trigger.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
name: Continuous Integration
name: Trigger dependencies
on:
push:
branches:
- master

env:
ORG_NAME: Bahmni
EVENT_TYPE: bahmni-scripts-trigger

jobs:
demo:
trigger-dependent-repos:
name: Trigger Workflows
runs-on: ubuntu-latest
strategy:
Expand All @@ -18,7 +20,7 @@ jobs:
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}"'"}')
trigger_result=$(curl -s -o trigger_response.txt -w "%{http_code}" -X POST -H "Accept: application/vnd.github.v3+json" -H 'authorization: Bearer ${{ secrets.BAHMNI_PAT }}' 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
Expand Down

0 comments on commit fc49cf0

Please sign in to comment.