Skip to content

Commit d13a8cb

Browse files
committed
CI: fix rat-check status reporting issue
Fix the "Expected - Waiting for status to be reported" issue for the rat-check status in the CI workflow. Changes made: - Remove the job's name to avoid GitHub cannot parse the right job - Rename the id of step "Run Apache Rat check" from rat-check to the new one `run-rat-check` - Add `Report Status` to strongen the workflow
1 parent a3e05cf commit d13a8cb

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/workflows/apache-rat-audit.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# using the command: `mvn clean verify -Drat.consoleOutput=true`
2424
# --------------------------------------------------------------------
2525

26-
name: Apache Rat Audit
26+
name: Apache Rat License Check
2727

2828
on:
2929
push:
@@ -42,7 +42,6 @@ concurrency:
4242

4343
jobs:
4444
rat-check:
45-
name: Apache Rat License Check
4645
runs-on: ubuntu-latest
4746
timeout-minutes: 10
4847

@@ -60,7 +59,6 @@ jobs:
6059
cache: maven
6160

6261
- name: Run Apache Rat check
63-
id: rat-check
6462
run: |
6563
echo "Running Apache Rat license check..."
6664
mvn clean verify -Drat.consoleOutput=true | tee rat-output.log
@@ -146,4 +144,19 @@ jobs:
146144
echo "### ⚠️ No Output Log Found"
147145
echo "The rat-output.log file was not generated."
148146
fi
149-
} >> "$GITHUB_STEP_SUMMARY"
147+
} >> "$GITHUB_STEP_SUMMARY"
148+
149+
- name: Report Status
150+
if: always()
151+
shell: bash {0}
152+
run: |
153+
if [[ -f rat-output.log ]] && grep -q "\[INFO\] BUILD SUCCESS" rat-output.log; then
154+
echo "✅ Apache Rat check completed successfully"
155+
exit 0
156+
elif [[ -f rat-output.log ]] && grep -q "\[INFO\] BUILD FAILURE" rat-output.log; then
157+
echo "❌ Apache Rat check failed"
158+
exit 1
159+
else
160+
echo "⚠️ Apache Rat check status unclear"
161+
exit 1
162+
fi

0 commit comments

Comments
 (0)