Skip to content

Commit aae9687

Browse files
Merge pull request #36 from nexB/fix-license-sync-32
Fix license sync bug
2 parents 355f106 + 94f9b1f commit aae9687

4 files changed

Lines changed: 10 additions & 27 deletions

File tree

.github/workflows/daily-update.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Update LicenseDB with latest updates from scancode-toolkit develop daily
22
on:
33
schedule:
4-
- cron: '0 16 * * 0-6'
4+
- cron: '0 16 * * 1-5'
55
workflow_dispatch:
66

77
jobs:
@@ -21,15 +21,13 @@ jobs:
2121
with:
2222
python-version: 3.8
2323

24-
- name: Give execute access to the script
25-
run: chmod u+x ./etc/scripts/check_commit_run_update.sh
26-
2724
- name: Run script
2825
run: ./etc/scripts/check_commit_run_update.sh
2926

3027
- name: Commit and Push to Publish
3128
run: |
3229
git config --global user.name 'LicenseDB Update GitHub Action'
3330
git config --global user.email 'asmahapatra@nexb.com'
34-
git commit -am "Automated LicenseDB update with latest from scancode-toolkit develop"
31+
git add docs/* etc/*
32+
git commit -m "Automated LicenseDB update with latest from scancode-toolkit develop"
3533
git push

Makefile

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,30 +41,15 @@ conf:
4141
@venv/bin/pip install -e ./scancode-toolkit/
4242
@venv/bin/scancode-reindex-licenses
4343

44-
restore:
44+
clean:
4545
@echo "-> Restoring the repository to a clean state"
4646
git clean -fd
4747
rm -rf scancode-toolkit/
4848
git restore --worktree docs/
4949

50-
clean:
51-
# Remove the whole content of docs/ except for the CNAME file
52-
# Remove the whole content of scancode-toolkit/
53-
find docs/* ! -name 'CNAME' -exec git rm -r {} +
54-
find scancode-toolkit/* -exec git rm -r {} +
55-
56-
html:
50+
licensedb:
5751
@echo "-> Generate the HTML content"
5852
@venv/bin/scancode-license-data --path docs/
5953
@echo "Available at docs/index.html"
6054

61-
build: conf html
62-
63-
publish:
64-
@echo "-> Add changes to git"
65-
@git add .
66-
git commit -m "Upgrade with latest updates from ScanCode-toolkit develop"
67-
@echo "-> Push changes to main repo"
68-
@git push
69-
70-
.PHONY: conf clean html build publish
55+
.PHONY: conf clean licensedb

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ Support
8585
Build
8686
-----
8787

88-
To re/generate the HTML and API content use this command::
88+
To re/generate the HTML and API content run the following script::
8989

90-
$ make restore conf html
90+
$ ./etc/scripts/check_commit_run_update.sh
9191

9292

9393
License

etc/scripts/check_commit_run_update.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

55
# Clear the repository
6-
make restore
6+
make clean
77

88
# Create a virtualenv and clone scancode
99
make conf
@@ -19,7 +19,7 @@ cd ../
1919
venv/bin/python ./etc/scripts/check_commit.py --commit "$COMMIT_LATEST"
2020

2121
# build docs
22-
make html
22+
make licensedb
2323

2424
# delete cloned scancode as only the doc updates should be commited
2525
rm -rf scancode-toolkit/

0 commit comments

Comments
 (0)