Skip to content

Commit

Permalink
Add GH action to run on pull request whenever there is focused check …
Browse files Browse the repository at this point in the history
…in the PR

Signed-off-by: Parthvi Vala <[email protected]>
  • Loading branch information
valaparthvi committed Feb 7, 2025
1 parent a45154a commit 1773fa0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/scripts/focus-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Note: This script has been generated by Gemini AI.

# Get the absolute path to the repository root
repo_root=$(git rev-parse --show-toplevel)

# Define the absolute path to the hosted directory
hosted_dir="$repo_root/hosted"

# Use grep to search for the specified strings within .go files in the hosted directory
grep_result=$(grep -ErnI --include="*.go" -e "FIt" -e "FDescribe" -e "FContext" -e "FWhen" -e "FEntry" -e "FDescribeTable" "$hosted_dir")

# Check if any matches were found
if [[ -n "$grep_result" ]]; then
echo "Found focused tests (FIt, FDescribe, etc.) in the '$hosted_dir' directory:"
echo "$grep_result"
exit 1 # Exit with a non-zero status to indicate failure
else
echo "No focused tests found in the '$hosted_dir' directory."
exit 0 # Exit with a zero status to indicate success
fi
13 changes: 13 additions & 0 deletions .github/workflows/focus-ginkgo-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Checking for focused runs

on: [push]

jobs:
check-focus-target:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Running the focus check script
run: |
./.github/scripts/focus-check.sh

0 comments on commit 1773fa0

Please sign in to comment.