File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed
Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 44 pull_request :
55 paths :
66 - " action.yaml"
7+ - " .github/workflows/target-workflow.yaml"
8+ - " .github/workflows/integration-tests.yaml"
9+ push :
10+ branches : ["main"]
11+ tags : ["*"]
12+ paths :
13+ - " action.yaml"
14+ - " .github/workflows/target-workflow.yaml"
715 - " .github/workflows/integration-tests.yaml"
816
917jobs :
6674 job_id : ${{ steps.wait-for-job-named.outputs.job-id }}
6775 conclusion : ${{ steps.wait-for-job-named.outputs.conclusion }}
6876
77+ setup-build-workflow :
78+ name : Setup Build Workflow
79+ # These permissions are needed to:
80+ # - Create a workflow dispatch event: https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event
81+ permissions :
82+ actions : write
83+ runs-on : ubuntu-latest
84+ steps :
85+ - name : Initiate target workflow
86+ uses : benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4
87+ with :
88+ workflow : target-workflow.yaml
89+ ref : ${{ github.head_ref || github.ref_name }} # Workflow dispatch only works on branches or tags
90+
6991 test-build-workflow :
7092 name : Test Build Workflow
93+ needs : setup-build-workflow
7194 # These permissions are needed to:
7295 # - Checkout the repo
7396 permissions :
79102 id : workflow-run
80103 with :
81104 workflow-file : target-workflow.yaml
82- commit-sha : ${{ github.event.pull_request.head.sha }}
105+ commit-sha : ${{ github.event.pull_request.head.sha || github.sha }}
83106 - uses : ./
84107 id : wait-for-job
85108 with :
Original file line number Diff line number Diff line change 11---
22name : Target Workflow
33on :
4- pull_request :
5- paths :
6- - " action.yaml"
7- - " .github/workflows/integration-tests.yaml"
4+ workflow_dispatch : {}
85
96jobs :
107 build :
You can’t perform that action at this time.
0 commit comments