Skip to content

Commit 2afbf9f

Browse files
committed
Add steps to checkout the PR branch
1 parent 1fb5727 commit 2afbf9f

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

.github/workflows/validate.yaml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,40 @@ on:
77
jobs:
88
sfp-validate-pool:
99
runs-on: ubuntu-latest
10+
permissions:
11+
pull-requests: write
1012
if: >
1113
github.event.issue.pull_request &&
1214
(
1315
contains(github.event.comment.body, '/quick-validation') ||
1416
contains(github.event.comment.body, '/full-validation')
1517
)
1618
steps:
17-
- name: Checkout
19+
- name: Fetch Branch Name
20+
id: fetch-branch-name
21+
uses: xt0rted/pull-request-comment-branch@v2
22+
23+
- name: Check out code from ${{ steps.fetch-branch-name.outputs.head_ref }}
1824
uses: actions/checkout@v3
25+
with:
26+
ref: ${{ steps.fetch-branch-name.outputs.head_ref }}
27+
28+
- name: Process PR comment
29+
id: comment
30+
run: |
31+
COMMENT_ID="${{ github.event.comment.id }}"
32+
COMMENT_BODY="${{ github.event.comment.body }}"
33+
echo "COMMENT_ID: $COMMENT_ID"
34+
echo "COMMENT_BODY: $COMMENT_BODY"
35+
36+
- name: Post response to GitHub PR
37+
uses: mshick/add-pr-comment@v2
38+
with:
39+
message: |
40+
Action started. Click [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) to see the status.
41+
42+
# - name: Checkout
43+
# uses: actions/checkout@v3
1944

2045
- name: Validate
2146
run: |
@@ -31,19 +56,7 @@ jobs:
3156
fi
3257
3358
34-
35-
36-
37-
38-
39-
40-
41-
42-
43-
44-
45-
46-
59+
4760

4861

4962

0 commit comments

Comments
 (0)