Skip to content

Commit f36df62

Browse files
committed
Added PR dry-run workflow for cd-integration
Added PR dry-run workflow for cd-integration Signed-off-by: AhmedSeemalK <ahmed.seemal@intel.com>
1 parent dcff633 commit f36df62

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/pr-workflow.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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"

0 commit comments

Comments
 (0)