Skip to content

Commit

Permalink
Try a different action to dispatch workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
qinsoon committed Jan 18, 2024
1 parent d9f2882 commit 83ad337
Showing 1 changed file with 29 additions and 10 deletions.
39 changes: 29 additions & 10 deletions .github/workflows/binding-tests-extended.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions: write-all

jobs:
binding-refs:
if: contains(github.event.pull_request.labels.*.name, 'PR-testing')
Expand All @@ -23,14 +25,31 @@ jobs:
needs: binding-refs
if: contains(github.event.pull_request.labels.*.name, 'PR-testing')
steps:
- name: Invoke binding workflows
uses: aurelien-baudet/workflow-dispatch@v2
- name: Split owner/repo
id: split-repo
run: |
owner=$(echo "${{ needs.binding-refs.outputs.openjdk_binding_repo }}" | cut -d'/' -f1)
repo=$(echo "${{ needs.binding-refs.outputs.openjdk_binding_repo}}" | cut -d'/' -f2)
echo "owner=$owner" >> $GITHUB_OUTPUT
echo "repo=$repo" >> $GITHUB_OUTPUT
# - name: Invoke binding workflows
# uses: convictional/trigger-workflow-and-wait@v1.6.5
# with:
# owner: ${{ steps.split-repo.outputs.owner }}
# repo: ${{ steps.split-repo.outputs.repo }}
# ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref }}
# github_token: ${{ secrets.GITHUB_TOKEN }}
# workflow_file_name: test-core-extended.yml
# client_payload: '{ "mmtk-core-repo": "${{ github.repository }}", "mmtk-core-ref": "${{ github.sha }}" }'
# wait_workflow: true
# wait_interval: 300
- name: Trigger Workflow
uses: actions/github-script@v6
with:
repo: ${{ needs.binding-refs.outputs.openjdk_binding_repo }}
ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
workflow: test-core-extended.yml
inputs: '{ "mmtk-core-repo": "${{ github.repository }}", "mmtk-core-ref": "${{ github.sha }}" }'
wait-for-completion: true
wait-for-completion-timeout: 6h
wait-for-completion-interval: 5m
script: |
github.rest.actions.createWorkflowDispatch({
owner: '${{ steps.split-repo.outputs.owner }}',
repo: '${{ steps.split-repo.outputs.repo }}',
workflow_id: 'test-core-extended.yml',
ref: '${{ needs.binding-refs.outputs.openjdk_binding_ref }}',
})

0 comments on commit 83ad337

Please sign in to comment.