From ada751912299a71f1b5194aa749f51fc46866b6a Mon Sep 17 00:00:00 2001 From: Pranav M S Krishnan Date: Fri, 19 Jun 2026 22:28:03 +0530 Subject: [PATCH 1/2] Refactor CI workflow for logic verification Updated workflow to trigger on completion of 'Welcome Bot' and modified steps for repository checkout and comment posting. Signed-off-by: Pranav M S Krishnan --- .github/workflows/verify.yml | 85 ++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 47 deletions(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 3cd3519..c1a9fe8 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -1,60 +1,51 @@ name: Logic Verification CI on: - push: # This tells GitHub when to run the script - branches: [ "main" ] - pull_request_target: # This allows the bot to talk on forks - branches: [ "main" ] + workflow_run: + workflows: ["Welcome Bot"] # name of 'welcome.yml' + types: + - completed jobs: - build: - runs-on: ubuntu-latest # We use Ubuntu (Linux) because it's the industry standard for servers + verify: + runs-on: ubuntu-latest + # Only run if the welcome bot succeeded + if: ${{ github.event.workflow_run.conclusion == 'success' }} permissions: - pull-requests: write # This gives the bot permission to comment + pull-requests: write contents: read steps: - - name: Checkout Repository - uses: actions/checkout@v4 - with: - # This ensures we test the code FROM the PR, not just the main branch - ref: ${{ github.event.pull_request.head.sha }} + - name: Checkout Repository + uses: actions/checkout@v4 + with: + # Use the repository context from the triggering workflow + repository: ${{ github.event.workflow_run.head_repository.full_name }} + ref: ${{ github.event.workflow_run.head_sha }} - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.11" + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" - - name: Install requirements # added for req - run: | - if [ -f requirements.txt ]; then - python -m pip install -r requirements.txt - else - echo "No requirements.txt found, skipping installation." - fi + - name: Install requirements + run: | + if [ -f requirements.txt ]; then + python -m pip install -r requirements.txt + fi - - name: Run Unit Tests - # It runs the file you merged in the last step. - run: python test_core.py + - name: Run Unit Tests + run: python test_core.py - - name: Post Success Comment - if: success() && (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') - uses: thollander/actions-comment-pull-request@v2 - with: - message: | - ### ✅ Logic Verified! - The **Automated Logic Suite** has confirmed that 1 is still 1. - - **Environment:** Ubuntu-latest - - **Status:** Mathematical Sanity Confirmed - - You are safe to merge this chaos. - github_token: ${{ secrets.GITHUB_TOKEN }} - - - name: Failure Comment - if: failure() && (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') - uses: thollander/actions-comment-pull-request@v2 - with: - message: "### ❌ LOGIC COLLAPSE\nThe automated suite has detected that 1 is no longer 1. Please fix the broken logic before merging." - github_token: ${{ secrets.GITHUB_TOKEN }} - - + - name: Post Comment + # Since this is a workflow_run, we need to pass the PR number manually + uses: thollander/actions-comment-pull-request@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + pull_request_number: ${{ github.event.workflow_run.pull_requests[0].number }} + message: | + ### ✅ Logic Verified! + The **Automated Logic Suite** has confirmed that 1 is still 1. + - **Status:** Mathematical Sanity Confirmed + + You are safe to merge this chaos. From aa9c64fe95d0927392abef271a0d4f6301147ded Mon Sep 17 00:00:00 2001 From: Pranav M S Krishnan Date: Fri, 19 Jun 2026 22:36:09 +0530 Subject: [PATCH 2/2] Refine comments and update workflow conditions Signed-off-by: Pranav M S Krishnan --- .github/workflows/verify.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index c1a9fe8..60df46e 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -2,14 +2,14 @@ name: Logic Verification CI on: workflow_run: - workflows: ["Welcome Bot"] # name of 'welcome.yml' + workflows: ["Welcome Bot"] # Must match the 'name' in welcome.yml types: - completed jobs: verify: runs-on: ubuntu-latest - # Only run if the welcome bot succeeded + # Only run if the Welcome Bot completed successfully if: ${{ github.event.workflow_run.conclusion == 'success' }} permissions: pull-requests: write @@ -19,7 +19,7 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 with: - # Use the repository context from the triggering workflow + # Pull the code from the PR that triggered the Welcome Bot repository: ${{ github.event.workflow_run.head_repository.full_name }} ref: ${{ github.event.workflow_run.head_sha }} @@ -32,20 +32,31 @@ jobs: run: | if [ -f requirements.txt ]; then python -m pip install -r requirements.txt + else + echo "No requirements.txt found, skipping installation." fi - name: Run Unit Tests run: python test_core.py - - name: Post Comment - # Since this is a workflow_run, we need to pass the PR number manually + - name: Post Success Comment + if: success() uses: thollander/actions-comment-pull-request@v2 with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} pull_request_number: ${{ github.event.workflow_run.pull_requests[0].number }} message: | ### ✅ Logic Verified! - The **Automated Logic Suite** has confirmed that 1 is still 1. + The **Automated Logic Suite** has confirmed that 1 is still 1. + - **Environment:** Ubuntu-latest - **Status:** Mathematical Sanity Confirmed You are safe to merge this chaos. + + - name: Failure Comment + if: failure() + uses: thollander/actions-comment-pull-request@v2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + pull_request_number: ${{ github.event.workflow_run.pull_requests[0].number }} + message: "### ❌ LOGIC COLLAPSE\nThe automated suite has detected that 1 is no longer 1. Please fix the broken logic before merging."