Skip to content
Merged
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
21 changes: 12 additions & 9 deletions .github/workflows/pr_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Check Review Status
id: check_reviews
uses: actions/github-script@v7
with:
script: |
core.setOutput('should_run', 'false');

const { data: reviews } = await github.rest.pulls.listReviews({
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -33,14 +31,19 @@ jobs:
const states = Object.values(latestReviews);
const allApproved = states.length > 0 && states.every(state => state === 'APPROVED');

if (!allApproved) {
console.log("Skipping ABI validation because not all reviewers approved.");
core.setOutput('should_run', 'false');
} else {
if (allApproved) {
console.log("All reviewers approved. Proceeding with validation.");
core.setOutput('should_run', 'true');
} else {
console.log("Skipping ABI validation because not all reviewers approved.");
core.setOutput('should_run', 'false');
}

- uses: actions/checkout@v4
if: steps.check_reviews.outputs.should_run == 'true'
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up JDK
if: steps.check_reviews.outputs.should_run == 'true'
uses: actions/setup-java@v4
Expand All @@ -55,4 +58,4 @@ jobs:

- name: ABI Validation
if: steps.check_reviews.outputs.should_run == 'true'
run: ./gradlew checkLegacyAbi -Pfull-build=true --no-configuration-cache
run: ./gradlew checkLegacyAbi -Pfull-build=true --no-configuration-cache