Skip to content

Commit 60b7575

Browse files
authored
chore: add build test final status for PR's status check (#14)
2 parents ec75c6c + b5654ec commit 60b7575

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
lines changed

.github/workflows/build-and-test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,31 @@ jobs:
190190
echo "Error: 'bumped' output is empty"
191191
exit 1
192192
fi
193+
194+
all-tests-passed:
195+
if: always()
196+
needs: [build-dist, test-python, test-npm, test-maven, test-version-file]
197+
runs-on: ubuntu-latest
198+
permissions:
199+
statuses: write
200+
steps:
201+
- name: Determine Status
202+
id: status
203+
run: |
204+
if [[ ${{ contains(needs.*.result, 'failure') }} == 'true' || ${{ contains(needs.*.result, 'cancelled') }} == 'true' ]]; then
205+
echo "status=failure" >> $GITHUB_OUTPUT
206+
else
207+
echo "status=success" >> $GITHUB_OUTPUT
208+
fi
209+
210+
- name: Set Commit Status
211+
uses: myrotvorets/set-commit-status-action@master
212+
with:
213+
token: ${{ secrets.GITHUB_TOKEN }}
214+
status: ${{ steps.status.outputs.status }}
215+
context: "all-tests-passed"
216+
description: "Aggregation of all tests"
217+
218+
- name: Fail if needed
219+
if: steps.status.outputs.status == 'failure'
220+
run: exit 1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ We as members, contributors, and leaders pledge to make participation in our com
115115

116116
## Licensing
117117

118-
Copyright (2025)2025 SAP SE or an SAP affiliate company and pull-request-semver-bumper contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/SAP/pull-request-semver-bumper).
118+
Copyright (2025) SAP SE or an SAP affiliate company and pull-request-semver-bumper contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/SAP/pull-request-semver-bumper).

package-lock.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)