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
1 change: 1 addition & 0 deletions .github/workflows/autoupdate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches:
- develop
- develop-2.0.0
- develop-3.x.x
jobs:
autoupdate:
name: auto-update
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/conventional-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
branches:
- develop
- develop-2.0.0
- develop-3.x.x
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-description-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
branches:
- develop
- develop-2.0.0
- develop-3.x.x
- release/*

jobs:
Expand Down
35 changes: 25 additions & 10 deletions .github/workflows/pr-supervisor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# We are using https://cli.github.com/manual/gh_pr_checks
# The aim is to ensure that conditionally triggered Yamato jobs are completed successfully before allowing merges

# This job will be required in branch protection rules for develop, develop-2.0.0, and release/* branches. It's only goal will be to ensure that Yamato jobs are completed successfully before allowing Pr to merge.
# Note that conditional jobs will have 30s to show which is always the cas since they are showing up as soon as in distribution stage.
# This job will be required in branch protection rules for develop and release/* branches. It's only goal will be to ensure that Yamato jobs are completed successfully before allowing Pr to merge.
# Note that conditional jobs will have 30s to show which is always the case since they are showing up as soon as in distribution stage.

name: Yamato PR Supervisor

Expand All @@ -13,8 +13,9 @@ on:
branches:
- develop
- develop-2.0.0
- develop-3.x.x
- release/*

concurrency:
group: pr-${{ github.event.pull_request.number }}
cancel-in-progress: true
Expand All @@ -23,13 +24,20 @@ jobs:
yamato-supervisor:
runs-on: ubuntu-latest
timeout-minutes: 720
permissions:
actions: read
checks: read
statuses: read
pull-requests: read
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v7

uses: actions/checkout@v4


- name: Wait and Verify Yamato Job Status
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
set -e
Expand All @@ -42,18 +50,25 @@ jobs:
for ((i=1;i<=MAX_ATTEMPTS;i++)); do
echo "Polling PR checks (attempt $i/$MAX_ATTEMPTS)..."

# We want to watch for pending checks beside this check
checks=$(gh pr checks $PR_NUMBER --json name,state --jq '[ .[] | select(.name != "yamato-supervisor") ]')

# gh pr checks exits non-zero while checks are pending (8) or failing (1); we evaluate state ourselves, so don't let that abort the loop.
checks=$(gh pr checks $PR_NUMBER --json name,state --jq '[ .[] | select(.name != "yamato-supervisor") ]') || true

if [[ -z "$checks" ]]; then
echo "No non-supervisor checks reported yet; waiting..."
sleep $INTERVAL
continue
fi

pending=$(echo "$checks" | jq '[.[] | select(.state == "PENDING")] | length')
skipping=$(echo "$checks" | jq '[.[] | select(.state == "SKIPPED")] | length')
passed=$(echo "$checks" | jq '[.[] | select(.state == "SUCCESS")] | length')
failed=$(echo "$checks" | jq '[.[] | select(.state == "FAILURE")] | length')

echo "Pending checks: $pending, Skipping checks: $skipping", Passed checks: $passed, Failed checks: $failed
echo "Pending checks: $pending; Skipping checks: $skipping, Passed checks: $passed, Failed checks: $failed"

if [[ "$failed" -gt 0 ]]; then
echo "A check has failed! Failing fast."
echo "If you rerun the job and everything is green then just rerun this job as well."
exit 1
fi

Expand Down
Loading
Loading