@@ -25,51 +25,44 @@ jobs:
2525 with :
2626 ref : ${{ steps.fetch-branch-name.outputs.head_ref }}
2727
28- - name : Process PR comment
29- id : comment
28+ - name : Process PR Comment
29+ id : process- comment
3030 run : |
3131 COMMENT_ID="${{ github.event.comment.id }}"
3232 COMMENT_BODY="${{ github.event.comment.body }}"
3333 echo "COMMENT_ID: $COMMENT_ID"
3434 echo "COMMENT_BODY: $COMMENT_BODY"
35-
36- - name : Post response to GitHub PR
37- uses : mshick/add-pr-comment@v2
38- with :
39- message-id : ${{ github.event.comment.id }}
40- message : |
41- Validation run started. Click [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) to see the status.
35+ echo "::set-output name=comment-id::$COMMENT_ID"
36+ if [[ "$COMMENT_BODY" == *"/quick-validation"* ]]; then
37+ echo "::set-output name=validation-type::quick"
38+ elif [[ "$COMMENT_BODY" == *"/full-validation"* ]]; then
39+ echo "::set-output name=validation-type::full"
40+ fi
4241
4342 # - name: Checkout
4443 # uses: actions/checkout@v3
4544
46- - name : Validate
45+ - name : Run Validation
46+ id : validate
4747 run : |
48- if [[ "${{ github.event. comment.body }}" == *"/ quick-validation"* ]]; then
48+ if [[ "${{ steps.process- comment.outputs.validation-type }}" == " quick" ]]; then
4949 echo "Running Quick Validation..."
50- # Add your quick validation commands here
51- elif [[ "${{ github.event.comment.body }}" == *"/full-validation"* ]]; then
50+ sleep 5 # Simulate quick validation
51+ echo "Quick Validation Successful" > result.txt
52+ elif [[ "${{ steps.process-comment.outputs.validation-type }}" == "full" ]]; then
5253 echo "Running Full Validation..."
53- # Add your full validation commands here
54- else
55- echo "No matching validation type found."
56- exit 1
54+ sleep 60 # Simulate full validation
55+ echo "Full Validation Successful" > result.txt
5756 fi
57+ continue-on-error : true
5858
59-
60-
61-
62-
63-
64-
65-
66-
67-
68-
69-
70-
71-
72-
59+ - name : Post Validation Status to PR
60+ uses : mshick/add-pr-comment@v2
61+ with :
62+ message : |
63+ Validation run completed: **${{ steps.process-comment.outputs.validation-type }}**
64+ Status: ${{ steps.validate.outcome == 'success' && '✅ Success' || '❌ Failed' }}
65+ [View the workflow run here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
7366
7467
7568
0 commit comments