From 68faffc12d791458b1f764adaa8e3369ab6998be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yusuf=20K=C3=B6r?= Date: Mon, 27 Jan 2025 15:38:20 +0100 Subject: [PATCH 1/2] wip --- .github/workflows/validate.yaml | 55 ++++++++++++++------------------- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 3825ea9..843446c 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -25,51 +25,44 @@ jobs: with: ref: ${{ steps.fetch-branch-name.outputs.head_ref }} - - name: Process PR comment - id: comment + - name: Process PR Comment + id: process-comment run: | COMMENT_ID="${{ github.event.comment.id }}" COMMENT_BODY="${{ github.event.comment.body }}" echo "COMMENT_ID: $COMMENT_ID" echo "COMMENT_BODY: $COMMENT_BODY" - - - name: Post response to GitHub PR - uses: mshick/add-pr-comment@v2 - with: - message-id: ${{ github.event.comment.id }} - message: | - Validation run started. Click [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) to see the status. + echo "::set-output name=comment-id::$COMMENT_ID" + if [[ "$COMMENT_BODY" == *"/quick-validation"* ]]; then + echo "::set-output name=validation-type::quick" + elif [[ "$COMMENT_BODY" == *"/full-validation"* ]]; then + echo "::set-output name=validation-type::full" + fi # - name: Checkout # uses: actions/checkout@v3 - - name: Validate + - name: Run Validation + id: validate run: | - if [[ "${{ github.event.comment.body }}" == *"/quick-validation"* ]]; then + if [[ "${{ steps.process-comment.outputs.validation-type }}" == "quick" ]]; then echo "Running Quick Validation..." - # Add your quick validation commands here - elif [[ "${{ github.event.comment.body }}" == *"/full-validation"* ]]; then + sleep 5 # Simulate quick validation + echo "Quick Validation Successful" > result.txt + elif [[ "${{ steps.process-comment.outputs.validation-type }}" == "full" ]]; then echo "Running Full Validation..." - # Add your full validation commands here - else - echo "No matching validation type found." - exit 1 + sleep 60 # Simulate full validation + echo "Full Validation Successful" > result.txt fi + continue-on-error: true - - - - - - - - - - - - - - + - name: Post Validation Status to PR + uses: mshick/add-pr-comment@v2 + with: + message: | + Validation run completed: **${{ steps.process-comment.outputs.validation-type }}** + Status: ${{ steps.validate.outcome == 'success' && '✅ Success' || '❌ Failed' }} + [View the workflow run here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) From c8c2eb3b028e5c58efe5207b1aaf0926419a9eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yusuf=20K=C3=B6r?= Date: Mon, 27 Jan 2025 15:40:28 +0100 Subject: [PATCH 2/2] wip --- .github/workflows/validate.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 843446c..d23f5b5 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -1,3 +1,4 @@ +#Test name: 'PR Review Comment' on: