Skip to content

Commit

Permalink
[License-Workflow] Fail workflow on automated vetting-requests
Browse files Browse the repository at this point in the history
Since #220 license-reviews
are automatically requested for PRs created by dependabot. But in that
change the logic of the 'Process license check results' step was not
updated to consider that case. This had the effect that the
license-vetting workflow always succeeded for PRs created by dependabot.

The intention to not fail the workflow in general when a license-review
was requested is because initially review-request were only created
manually from committers by adding a corresponding comment to the PR.
And that workflow execution should not fail respectively its result was
actually irrelevant.

Fixes eclipse-tycho/tycho#3661
  • Loading branch information
HannesWell committed Mar 17, 2024
1 parent eebe9bf commit 8d958f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/mavenLicenseCheck.yml
Expand Up @@ -145,11 +145,15 @@ jobs:
const licenesVetted = ${{ steps.check-license-vetting.outputs.licenses-vetted }}
let commentBody = ''
// if context.payload.comment is empty, this is an explicit review-request through a comment, if not an automated one, e.g. for dependabot PRs
if ( context.payload.comment ) {
commentBody += '> ' + context.payload.comment.body + '\n\n'
} else if ( licenesVetted ){
core.info('License review request made automatically but all licenses are already vetted.')
return; // Don't create a comment in this case, the checks in the UI indicate the state already.
} else {
// This run encountered pending reviews, which have been requested automatically, e.g. for dependabot PRs
core.setFailed("Some dependencies must be vetted and their review was requested. Rerun this check once these reviews succeeded.")
}
if( licenesVetted ) {
Expand Down

0 comments on commit 8d958f8

Please sign in to comment.