Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ name: Python Tests

on:
push:
branches: ["**"]
# Exclude beta and main: those branches re-trigger this workflow via
# workflow_call from beta-release.yml / release.yml. Without the exclusion,
# a push to beta that touches Server/** fires this workflow twice for the
# same SHA, and GitHub auto-cancels the duplicate.
branches-ignore: [beta, main]
Comment on lines +5 to +9
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify that beta-release.yml and release.yml call python-tests.yml

echo "=== Checking beta-release.yml ==="
if [ -f .github/workflows/beta-release.yml ]; then
  echo "File exists. Searching for python-tests workflow_call..."
  rg -n "uses:.*python-tests" .github/workflows/beta-release.yml || echo "No direct 'uses' found, checking for workflow references..."
  rg -n -C3 "python-tests\.yml" .github/workflows/beta-release.yml || echo "⚠️  No reference to python-tests.yml found"
else
  echo "⚠️  beta-release.yml not found"
fi

echo ""
echo "=== Checking release.yml ==="
if [ -f .github/workflows/release.yml ]; then
  echo "File exists. Searching for python-tests workflow_call..."
  rg -n "uses:.*python-tests" .github/workflows/release.yml || echo "No direct 'uses' found, checking for workflow references..."
  rg -n -C3 "python-tests\.yml" .github/workflows/release.yml || echo "⚠️  No reference to python-tests.yml found"
else
  echo "⚠️  release.yml not found"
fi

Repository: CoplayDev/unity-mcp

Length of output: 716


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== on: section (beta-release.yml) ==="
if [ -f .github/workflows/beta-release.yml ]; then
  awk 'BEGIN{p=0}
       /^on:/{p=1}
       p{print}
       p && /^jobs:/{exit}' .github/workflows/beta-release.yml | sed -n '1,200p'
  echo
  echo "=== branches filters (beta-release.yml) ==="
  rg -n "branches" .github/workflows/beta-release.yml || true
else
  echo "beta-release.yml not found"
fi

echo
echo "=== on: section (release.yml) ==="
if [ -f .github/workflows/release.yml ]; then
  awk 'BEGIN{p=0}
       /^on:/{p=1}
       p{print}
       p && /^jobs:/{exit}' .github/workflows/release.yml | sed -n '1,200p'
  echo
  echo "=== branches filters (release.yml) ==="
  rg -n "branches" .github/workflows/release.yml || true
else
  echo "release.yml not found"
fi

Repository: CoplayDev/unity-mcp

Length of output: 710


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== python-tests.yml on: section ==="
awk 'BEGIN{p=0}
     /^on:/{p=1}
     p{print}
     p && /^jobs:/{exit}' .github/workflows/python-tests.yml | sed -n '1,220p'

echo
echo "=== Does python-tests.yml define workflow_call? ==="
rg -n "workflow_call" .github/workflows/python-tests.yml || true

echo
echo "=== Any other workflows calling release.yml (workflow_call uses release.yml) ==="
rg -n "uses: \./\.github/workflows/release\.yml" .github/workflows --glob='*.yml' || true

echo
echo "=== Any other workflows calling beta-release.yml (workflow_call uses beta-release.yml) ==="
rg -n "uses: \./\.github/workflows/beta-release\.yml" .github/workflows --glob='*.yml' || true

Repository: CoplayDev/unity-mcp

Length of output: 1157


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== workflows that reference release.yml ==="
rg -n "uses:\s*\./\.github/workflows/release\.yml" .github/workflows --glob='*.yml' || true

echo
echo "=== workflows that reference beta-release.yml ==="
rg -n "uses:\s*\./\.github/workflows/beta-release\.yml" .github/workflows --glob='*.yml' || true

echo
echo "=== any plain mentions of release.yml in workflow_call contexts ==="
rg -n "workflow_call:[\s\S]{0,600}?release\.yml" .github/workflows --glob='*.yml' || true

echo
echo "=== any plain mentions of beta-release.yml in workflow_call contexts ==="
rg -n "workflow_call:[\s\S]{0,600}?beta-release\.yml" .github/workflows --glob='*.yml' || true

Repository: CoplayDev/unity-mcp

Length of output: 302


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== All jobs.*.uses references to python-tests.yml ==="
rg -n "uses:\s*\./\.github/workflows/python-tests\.yml" .github/workflows --glob='*.yml' || true

echo
echo "=== For each referencing workflow, show its on: block (first ~80 lines) ==="
# Get unique workflow filenames from rg matches
rg -l "uses:\s*\./\.github/workflows/python-tests\.yml" .github/workflows --glob='*.yml' | sort | while read -r f; do
  echo
  echo "---- ${f} : on: block ----"
  awk 'BEGIN{p=0}
       /^on:/{p=1}
       p{print}
       p && /^jobs:/{exit}' "$f" | sed -n '1,120p'
done

Repository: CoplayDev/unity-mcp

Length of output: 869


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Any mentions of python-tests.yml in workflows ==="
rg -n "python-tests\.yml" .github/workflows --glob='*.yml' || true

echo
echo "=== Any uses: references to python-tests.yml (path variations) ==="
rg -n "uses:\s*.*python-tests\.yml" .github/workflows --glob='*.yml' || true

Repository: CoplayDev/unity-mcp

Length of output: 800


Update: beta-release.yml and release.yml call the reusable python-tests workflow

beta-release.yml and release.yml both invoke .github/workflows/python-tests.yml via jobs.*.uses (python-tests.yml declares on: workflow_call and both callers use it). Also, python-tests.yml’s push trigger explicitly ignores beta and main (branches-ignore: [beta, main]), so the “exclude beta/main to avoid duplicate runs” rationale matches the workflow setup.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/python-tests.yml around lines 5 - 9, The inline comment
explaining why branches-ignore excludes beta and main is misleading; update it
to explicitly state that this workflow declares on: workflow_call and is invoked
by other workflows (beta-release.yml and release.yml), so branches-ignore:
[beta, main] prevents duplicate runs when those callers trigger the reusable
python-tests workflow; modify the comment text around branches-ignore to reflect
that the exclusion is intentional because of workflow_call usage rather than
removing the exclusion or changing triggers.

Comment on lines +5 to +9
paths:
- Server/**
- .github/workflows/python-tests.yml
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/unity-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ on:
required: false
default: ""
push:
branches: ["**"]
# Exclude beta and main: those branches re-trigger this workflow via
# workflow_call from beta-release.yml / release.yml. Without the exclusion,
# a push to beta that touches MCPForUnity/** fires this workflow twice
# for the same SHA, and GitHub's auto-generated concurrency group
# (`unity-tests-refs/heads/beta`) cancels the older run with the noisy
# "higher priority waiting request" annotation.
branches-ignore: [beta, main]
Comment on lines +13 to +19
paths:
- TestProjects/UnityMCPTests/**
- MCPForUnity/Editor/**
Expand Down
Loading