2020-02-08 09:51:06 +08:00
|
|
|
name: Scancode
|
|
|
|
|
|
|
|
on: [pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
scancode_job:
|
2023-03-18 18:11:12 +08:00
|
|
|
runs-on: ubuntu-22.04
|
2020-02-08 09:51:06 +08:00
|
|
|
name: Scan code for licenses
|
|
|
|
steps:
|
|
|
|
- name: Checkout the code
|
2024-01-27 12:26:39 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-10-19 07:58:17 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-02-08 09:51:06 +08:00
|
|
|
- name: Scan the code
|
|
|
|
id: scancode
|
2022-03-30 02:51:37 +08:00
|
|
|
uses: zephyrproject-rtos/action_scancode@v4
|
2020-02-08 09:51:06 +08:00
|
|
|
with:
|
|
|
|
directory-to-scan: 'scan/'
|
|
|
|
- name: Artifact Upload
|
2024-01-27 12:26:39 +08:00
|
|
|
uses: actions/upload-artifact@v4
|
2020-02-08 09:51:06 +08:00
|
|
|
with:
|
|
|
|
name: scancode
|
|
|
|
path: ./artifacts
|
|
|
|
|
|
|
|
- name: Verify
|
|
|
|
run: |
|
|
|
|
if [ -s ./artifacts/report.txt ]; then
|
|
|
|
report=$(cat ./artifacts/report.txt)
|
|
|
|
report="${report//'%'/'%25'}"
|
|
|
|
report="${report//$'\n'/'%0A'}"
|
|
|
|
report="${report//$'\r'/'%0D'}"
|
|
|
|
echo "::error file=./artifacts/report.txt::$report"
|
|
|
|
exit 1
|
|
|
|
fi
|