@@ -107,42 +107,39 @@ jobs:
107107 dashLicenseToolJar=$(ls ~/.m2/repository/org/eclipse/dash/org.eclipse.dash.licenses/1.1.0/org.eclipse.dash.licenses-*.jar | tail -n 1)
108108 npmArgs=" --no-bin-links --ignore-scripts"
109109 dashArgs="-excludeSources local -summary $savePWD/target/dash/npm-review-summary"
110- reviewArgs="-review -project $projectId -token $gitlabAPIToken"
111- requestReview="${{ env.request-review }}"
112- # When a review was requested explicitly (e.g. '/request-license-review' comment), ask for it right away.
113- if [ "$requestReview" ]; then
114- dashArgs="$dashArgs $reviewArgs"
110+ exitStatus=0
111+ if [ ${{ env.request-review }} ]; then
112+ # Add "-project <Project Name> -token <Token>" here when a review is required
113+ dashArgs="$dashArgs -review -project $projectId -token $gitlabAPIToken"
115114 fi
116115 #
117116 # Check NPM dependency licenses in main WildWebDeveloper project
118117 #
119118 echo ""
120119 echo "------ Checking project [org.eclipse.wildwebdeveloper] ------"
121120 java -jar $dashLicenseToolJar $dashArgs org.eclipse.wildwebdeveloper/package-lock.json
122- exitStatus=$?
123- cd $savePWD
124-
125- # If unvetted content was found and no review was requested yet, request one automatically,
126- # i.e. re-run the check with '-review' as if a committer had commented '/request-license-review'.
127- if [[ $exitStatus != 0 && -z "$requestReview" ]]; then
128- echo ""
129- echo "Some contents are not vetted - automatically requesting a license review"
130- requestReview=1
131- echo "request-review=1" >> $GITHUB_ENV
132- java -jar $dashLicenseToolJar $dashArgs $reviewArgs org.eclipse.wildwebdeveloper/package-lock.json
133- cd $savePWD
121+ currentStatus=$?
122+ if [[ $currentStatus != 0 ]]; then
123+ exitStatus=$(($exitStatus + $currentStatus)) # Save for future
134124 fi
135-
125+ cd $savePWD
126+
136127 echo ""
137128 if [[ $exitStatus == 0 ]]; then # All licenses are vetted
129+ # echo "::set-output name=build-succeeded::$(echo 1)"
138130 echo "build-succeeded=1" >> $GITHUB_OUTPUT
139131 echo "All licenses are vetted"
140132 else
133+ # echo "::set-output name=build-succeeded::$(echo 0)"
141134 echo "build-succeeded=0" >> $GITHUB_OUTPUT
142- echo "Some contents requires a review"
143- echo "The NPM dependency License Check review summary is saved in 'target/dash/npm-review-summary'"
144- # Fail the check so the PR is not merged while reviews are pending; re-run once the reviews have concluded.
145- exit 1
135+ if [ ${{ env.request-review }} ]; then
136+ echo "Some contents requires a review"
137+ echo ""
138+ echo "The NPM dependency License Check review summary is saved in 'target/dash/npm-review-summary'"
139+ else
140+ echo "Committers can request a review by commenting '/request-license-review'"
141+ exit 1
142+ fi
146143 fi
147144 echo ""
148145
0 commit comments