Skip to content

Commit 933d839

Browse files
authored
Merge pull request #492 from Raphael-Gazzotti/strategy-upstream
Replace curl dispatches with matrix strategy.
2 parents fb58587 + 3086867 commit 933d839

1 file changed

Lines changed: 38 additions & 7 deletions

File tree

.github/workflows/openMINDS_upstream.yml

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,44 @@ on:
1313
jobs:
1414
build:
1515
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
include:
20+
- repo: openMetadataInitiative/openMINDS_json-schema
21+
workflow: build.yml
22+
23+
- repo: openMetadataInitiative/openMINDS_MATLAB
24+
workflow: build.yml
25+
26+
- repo: openMetadataInitiative/openMINDS_Python
27+
workflow: build.yml
28+
29+
- repo: openMetadataInitiative/openMINDS_Python-dev
30+
workflow: build-dev.yml
31+
32+
- repo: openMetadataInitiative/openMINDS_LinkML
33+
workflow: build.yml
34+
35+
- repo: openMetadataInitiative/openMINDS_documentation
36+
workflow: build.yml
37+
38+
- repo: openMetadataInitiative/openMINDS_documentation
39+
workflow: htaccess-deploy.yml
40+
1641
steps:
1742
- name: Trigger target repositories
1843
run: |
19-
curl -s -w "\nJSON-Schema: %{http_code}\n" -XPOST -u "${{secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/openMetadataInitiative/openMINDS_json-schema/actions/workflows/build.yml/dispatches --data '{"ref": "pipeline", "inputs": {"branch": "${{github.ref_name}}", "repository": "${{ github.repository }}"}}'
20-
curl -s -w "\nMATLAB: %{http_code}\n" -XPOST -u "${{secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" -H "${{secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/openMetadataInitiative/openMINDS_MATLAB/actions/workflows/build.yml/dispatches --data '{"ref": "pipeline", "inputs": {"branch": "${{github.ref_name}}", "repository": "${{ github.repository }}"}}'
21-
curl -s -w "\nPython: %{http_code}\n" -XPOST -u "${{secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" -H "${{secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/openMetadataInitiative/openMINDS_Python/actions/workflows/build.yml/dispatches --data '{"ref": "pipeline", "inputs": {"branch": "${{github.ref_name}}", "repository": "${{ github.repository }}"}}'
22-
curl -s -w "\nPython-dev: %{http_code}\n" -XPOST -u "${{secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" -H "${{secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/openMetadataInitiative/openMINDS_Python/actions/workflows/build-dev.yml/dispatches --data '{"ref": "pipeline", "inputs": {"branch": "${{github.ref_name}}", "repository": "${{ github.repository }}"}}'
23-
curl -s -w "\nLinkML: %{http_code}\n" -XPOST -u "${{secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/openMetadataInitiative/openMINDS_LinkML/actions/workflows/build.yml/dispatches --data '{"ref": "pipeline", "inputs": {"branch": "${{github.ref_name}}", "repository": "${{ github.repository }}"}}'
24-
curl -s -w "\nDocs build: %{http_code}\n" -XPOST -u "${{secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/openMetadataInitiative/openMINDS_documentation/actions/workflows/build.yml/dispatches --data '{"ref": "pipeline", "inputs": {"branch": "${{github.ref_name}}", "repository": "${{ github.repository }}"}}'
25-
curl -s -w "\nDocs htaccess: %{http_code}\n" -XPOST -u "${{secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/openMetadataInitiative/openMINDS_documentation/actions/workflows/htaccess-deploy.yml/dispatches --data '{"ref": "pipeline", "inputs": {"branch": "${{github.ref_name}}", "repository": "${{ github.repository }}"}}'
44+
curl -s -w "\n${{ matrix.repo }}: %{http_code}\n" \
45+
-X POST \
46+
-u "${{ secrets.PAT_USERNAME }}:${{ secrets.PAT_TOKEN }}" \
47+
-H "Accept: application/vnd.github+json" \
48+
-H "Content-Type: application/json" \
49+
https://api.github.com/repos/${{ matrix.repo }}/actions/workflows/${{ matrix.workflow }}/dispatches \
50+
--data "{
51+
\"ref\": \"pipeline\",
52+
\"inputs\": {
53+
\"branch\": \"${{ github.ref_name }}\",
54+
\"repository\": \"${{ github.repository }}\"
55+
}
56+
}"

0 commit comments

Comments
 (0)