File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : pr-workflow
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - cd-integration
7+ workflow_dispatch :
8+ inputs :
9+ pr_number :
10+ description : ' Pull request number to dry run'
11+ required : true
12+
13+ jobs :
14+ dry-run :
15+ name : Dry Run
16+ runs-on : pr-workflow
17+ steps :
18+ - name : Determine target ref
19+ id : target
20+ run : |
21+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
22+ if [ -z "${{ github.event.inputs.pr_number }}" ]; then
23+ echo "pr_number input is required" >&2
24+ exit 1
25+ fi
26+ echo "ref=refs/pull/${{ github.event.inputs.pr_number }}/merge" >> "$GITHUB_OUTPUT"
27+ else
28+ echo "ref=refs/pull/${{ github.event.pull_request.number }}/merge" >> "$GITHUB_OUTPUT"
29+ fi
30+
31+ - name : Checkout target
32+ uses : actions/checkout@v4
33+ with :
34+ ref : ${{ steps.target.outputs.ref }}
35+ fetch-depth : 0
36+
37+ - name : Dry run summary
38+ run : |
39+ echo "=== Dry Run Context ==="
40+ echo "Event : ${{ github.event_name }}"
41+ echo "Repository : ${{ github.repository }}"
42+ echo "Target ref : ${{ steps.target.outputs.ref }}"
43+ echo "Runner label : pr-workflow"
44+ echo "Dry run complete"
You can’t perform that action at this time.
0 commit comments