Skip to content

Commit b5a3d28

Browse files
committed
add more space for qnx build
1 parent 13fbcdf commit b5a3d28

2 files changed

Lines changed: 123 additions & 1 deletion

File tree

.github/workflows/build_and_test_qnx.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# *******************************************************************************
1313
name: QNX8 - Build & Integration Test
1414
on:
15-
pull_request_target:
15+
pull_request:
1616
types: [opened, reopened, synchronize]
1717
merge_group:
1818
types: [checks_requested]
@@ -32,6 +32,8 @@ jobs:
3232
contents: read
3333
pull-requests: read
3434
steps:
35+
- name: Clean disk space
36+
uses: eclipse-score/more-disk-space@v1
3537
- name: Checkout repository (Handle all events)
3638
uses: actions/checkout@v4.2.2
3739
with:
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
name: Check Release Branch Approvals
14+
15+
on:
16+
pull_request:
17+
types: [opened, reopened, synchronize, review_requested, submitted]
18+
branches:
19+
- 'release/**'
20+
21+
jobs:
22+
check-approvals:
23+
name: Verify Required Approvals
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Check out code
27+
uses: actions/checkout@v4
28+
29+
- name: Get PR Reviews
30+
id: get-reviews
31+
uses: actions/github-script@v7
32+
with:
33+
github-token: ${{ secrets.GITHUB_TOKEN }}
34+
script: |
35+
// Define required approvers (GitHub usernames)
36+
const requiredApprovers = [
37+
'user1',
38+
'user2',
39+
'user3'
40+
];
41+
42+
// Get all reviews for this PR
43+
const { data: reviews } = await github.rest.pulls.listReviews({
44+
owner: context.repo.owner,
45+
repo: context.repo.repo,
46+
pull_number: context.payload.pull_request.number
47+
});
48+
49+
// Get the latest review state from each user
50+
const latestReviewsByUser = {};
51+
for (const review of reviews) {
52+
const username = review.user.login;
53+
const submittedAt = new Date(review.submitted_at);
54+
55+
if (!latestReviewsByUser[username] ||
56+
new Date(latestReviewsByUser[username].submitted_at) < submittedAt) {
57+
latestReviewsByUser[username] = review;
58+
}
59+
}
60+
61+
// Check which required approvers have approved
62+
const approvedBy = [];
63+
const notApprovedBy = [];
64+
65+
for (const requiredApprover of requiredApprovers) {
66+
const userReview = latestReviewsByUser[requiredApprover];
67+
68+
if (userReview && userReview.state === 'APPROVED') {
69+
approvedBy.push(requiredApprover);
70+
} else {
71+
notApprovedBy.push(requiredApprover);
72+
}
73+
}
74+
75+
// Output results
76+
console.log('Required approvers:', requiredApprovers.join(', '));
77+
console.log('Approved by:', approvedBy.join(', ') || 'none');
78+
console.log('Not approved by:', notApprovedBy.join(', ') || 'none');
79+
80+
// Set outputs
81+
core.setOutput('approved-by', approvedBy.join(', '));
82+
core.setOutput('not-approved-by', notApprovedBy.join(', '));
83+
core.setOutput('all-approved', notApprovedBy.length === 0 ? 'true' : 'false');
84+
85+
// Return status
86+
return {
87+
requiredApprovers,
88+
approvedBy,
89+
notApprovedBy,
90+
allApproved: notApprovedBy.length === 0
91+
};
92+
93+
- name: Summary
94+
run: |
95+
echo "### Release Approval Check Results" >> $GITHUB_STEP_SUMMARY
96+
echo "" >> $GITHUB_STEP_SUMMARY
97+
echo "**Target Branch:** ${{ github.base_ref }}" >> $GITHUB_STEP_SUMMARY
98+
echo "" >> $GITHUB_STEP_SUMMARY
99+
if [ "${{ steps.get-reviews.outputs.all-approved }}" == "true" ]; then
100+
echo "✅ **Status:** All required approvers have approved this PR" >> $GITHUB_STEP_SUMMARY
101+
else
102+
echo "❌ **Status:** Missing approvals from required reviewers" >> $GITHUB_STEP_SUMMARY
103+
fi
104+
echo "" >> $GITHUB_STEP_SUMMARY
105+
echo "**Approved by:** ${{ steps.get-reviews.outputs.approved-by }}" >> $GITHUB_STEP_SUMMARY
106+
echo "" >> $GITHUB_STEP_SUMMARY
107+
echo "**Awaiting approval from:** ${{ steps.get-reviews.outputs.not-approved-by }}" >> $GITHUB_STEP_SUMMARY
108+
109+
- name: Fail if not all approved
110+
if: steps.get-reviews.outputs.all-approved != 'true'
111+
run: |
112+
echo "❌ Not all required approvers have approved this PR"
113+
echo "Missing approvals from: ${{ steps.get-reviews.outputs.not-approved-by }}"
114+
exit 1
115+
116+
- name: Success
117+
if: steps.get-reviews.outputs.all-approved == 'true'
118+
run: |
119+
echo "✅ All required approvers have approved this PR"
120+
echo "Approved by: ${{ steps.get-reviews.outputs.approved-by }}"

0 commit comments

Comments
 (0)