Refactor Order of Err Checks in HandleReactionAdded | Better Timeout Handling for Message Caching #41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Ensure Uptime Line Uncommented | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| check-line: | |
| runs-on: [self-hosted, homelab] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Ensure main.cs exists | |
| run: | | |
| if [ ! -f "main.cs" ]; then | |
| echo "β main.cs not found!" | |
| exit 1 | |
| fi | |
| - name: Check main.cs for uncommented line | |
| env: | |
| REQUIRED_LINE: "Uptime.StartHttpListener();" | |
| run: | | |
| FILE="main.cs" | |
| echo "Searching for '${REQUIRED_LINE}' in $FILE" | |
| # Find all lines containing the required string (with line numbers) | |
| matches=$(grep -n -F "${REQUIRED_LINE}" "$FILE" || true) | |
| if [ -z "$matches" ]; then | |
| echo "β Required line '${REQUIRED_LINE}' is missing entirely" | |
| exit 1 | |
| fi | |
| echo "Found these lines containing '${REQUIRED_LINE}':" | |
| echo "$matches" | |
| # Strip line numbers before checking for comments | |
| uncommented=$(echo "$matches" | cut -d: -f2- | grep -v '^[[:space:]]*//') | |
| if [ -z "$uncommented" ]; then | |
| echo "β All instances of '${REQUIRED_LINE}' are commented out" | |
| exit 1 | |
| fi | |
| echo "β Found at least one uncommented instance of '${REQUIRED_LINE}'" |