-
Notifications
You must be signed in to change notification settings - Fork 44.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into zamilmajdy/code-validation
- Loading branch information
Showing
150 changed files
with
19,686 additions
and
1,862 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import os | ||
import requests | ||
import sys | ||
|
||
# GitHub API endpoint | ||
api_url = os.environ["GITHUB_API_URL"] | ||
repo = os.environ["GITHUB_REPOSITORY"] | ||
sha = os.environ["GITHUB_SHA"] | ||
|
||
# GitHub token for authentication | ||
github_token = os.environ["GITHUB_TOKEN"] | ||
|
||
# API endpoint for check runs for the specific SHA | ||
endpoint = f"{api_url}/repos/{repo}/commits/{sha}/check-runs" | ||
|
||
# Set up headers for authentication | ||
headers = { | ||
"Authorization": f"token {github_token}", | ||
"Accept": "application/vnd.github.v3+json" | ||
} | ||
|
||
# Make the API request | ||
response = requests.get(endpoint, headers=headers) | ||
|
||
if response.status_code != 200: | ||
print(f"Error: Unable to fetch check runs data. Status code: {response.status_code}") | ||
sys.exit(1) | ||
|
||
check_runs = response.json()["check_runs"] | ||
|
||
# Flag to track if all other check runs have passed | ||
all_others_passed = True | ||
|
||
# Current run id | ||
current_run_id = os.environ["GITHUB_RUN_ID"] | ||
|
||
for run in check_runs: | ||
if str(run["id"]) != current_run_id: | ||
status = run["status"] | ||
conclusion = run["conclusion"] | ||
|
||
if status == "completed": | ||
if conclusion not in ["success", "skipped", "neutral"]: | ||
all_others_passed = False | ||
print(f"Check run {run['name']} (ID: {run['id']}) has conclusion: {conclusion}") | ||
else: | ||
print(f"Check run {run['name']} (ID: {run['id']}) is still {status}.") | ||
all_others_passed = False | ||
|
||
if all_others_passed: | ||
print("All other completed check runs have passed. This check passes.") | ||
sys.exit(0) | ||
else: | ||
print("Some check runs have failed or have not completed. This check fails.") | ||
sys.exit(1) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: PR Status Checker | ||
on: | ||
workflow_run: | ||
workflows: ["*"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
status-check: | ||
name: Check Actions Status | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install requests | ||
- name: Debug Information | ||
run: | | ||
echo "Event name: ${{ github.event_name }}" | ||
echo "Workflow: ${{ github.workflow }}" | ||
echo "Action: ${{ github.action }}" | ||
echo "Actor: ${{ github.actor }}" | ||
echo "Repository: ${{ github.repository }}" | ||
echo "Ref: ${{ github.ref }}" | ||
echo "Head ref: ${{ github.head_ref }}" | ||
echo "Base ref: ${{ github.base_ref }}" | ||
echo "Event payload:" | ||
cat $GITHUB_EVENT_PATH | ||
- name: Debug File Structure | ||
run: | | ||
echo "Current directory:" | ||
pwd | ||
echo "Directory contents:" | ||
ls -R | ||
echo "GitHub workspace:" | ||
echo $GITHUB_WORKSPACE | ||
echo "GitHub workspace contents:" | ||
ls -R $GITHUB_WORKSPACE | ||
- name: Check Actions Status | ||
run: | | ||
echo "Current directory before running Python script:" | ||
pwd | ||
echo "Attempting to run Python script:" | ||
python .github/scripts/check_actions_status.py | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,6 @@ dist/ | |
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
|
Oops, something went wrong.