Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3rd party license check #321

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,25 @@ jobs:
- name: "Generate new LICENSE-3rdparty.yml and check against the previous"
env:
CARGO_HOME: "/tmp/dd-cargo"
run: >
run: |
# Run cargo bundle-licenses without directly checking against a previous snapshot
cargo bundle-licenses \
--format yaml \
--output /tmp/CI.yaml \
--previous LICENSE-3rdparty.yml \
--check-previous \
|| diff /tmp/CI.yaml LICENSE-3rdparty.yml
--output /tmp/CI.yaml

# Normalize the paths in both files to ignore registry differences
sed -E 's/(registry\/src\/)[^\/]+/\1normalized_path/g' /tmp/CI.yaml > /tmp/CI_normalized.yaml
sed -E 's/(registry\/src\/)[^\/]+/\1normalized_path/g' LICENSE-3rdparty.yml > /tmp/LICENSE-3rdparty_normalized.yml

# Now perform the diff on the normalized files
if ! diff /tmp/CI_normalized.yaml /tmp/LICENSE-3rdparty_normalized.yml; then
echo "Differences detected."
exit 1
fi

echo "No differences found."


- name: export the generated license file on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v3
Expand Down
Loading