Skip to content

Commit

Permalink
Merge pull request #32 from route06inc/migrate-notice-md-to-license-h…
Browse files Browse the repository at this point in the history
…tml-report

Migrate NOTICE.md to License report
  • Loading branch information
masutaka authored Oct 25, 2024
2 parents 33646e1 + 45ff64f commit 14d51ae
Show file tree
Hide file tree
Showing 5 changed files with 10,295 additions and 89 deletions.
75 changes: 51 additions & 24 deletions .github/workflows/license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,72 @@ on:
jobs:
license_finder:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
timeout-minutes: 10
env:
LICENSE_REPORT: docs/packages-license.md
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.CI_TRIGGER_APP_ID }}
private-key: ${{ secrets.CI_TRIGGER_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ steps.app-token.outputs.token }}
# To make the success of this job a prerequisite for merging into the main branch,
# set a filter here instead of on: to determine whether or not to proceed to the next step.
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
- name: Cache dependency files
uses: actions/cache@v4
id: cache
with:
filters: |
target:
- .github/workflows/license.yml
- bun.lockb
- config/dependency_decisions.yml
- config/license_finder.yml
- package.json
path: |
.github/workflows/license.yml
bun.lockb
config/dependency_decisions.yml
config/license_finder.yml
package.json
key: license-${{ runner.os }}-${{ hashFiles('.github/workflows/license.yml', 'bun.lockb', 'config/dependency_decisions.yml', 'config/license_finder.yml', 'package.json') }}
- name: Determine if files changed
id: determine
run: |
if [ "${{ steps.cache.outputs.cache-hit }}" = 'true' ]; then
echo "files_changed=false" >> "$GITHUB_OUTPUT"
else
echo "files_changed=true" >> "$GITHUB_OUTPUT"
fi
- uses: oven-sh/setup-bun@v2
if: steps.changes.outputs.target == 'true'
if: steps.determine.outputs.files_changed == 'true'
with:
bun-version-file: "package.json"
- run: bun install
if: steps.changes.outputs.target == 'true'
if: steps.determine.outputs.files_changed == 'true'
- uses: ruby/setup-ruby@v1
if: steps.changes.outputs.target == 'true'
if: steps.determine.outputs.files_changed == 'true'
with:
ruby-version: '3.3'
- name: Install License Finder
if: steps.changes.outputs.target == 'true'
if: steps.determine.outputs.files_changed == 'true'
run: gem install -N license_finder
- name: Run License Finder
if: steps.changes.outputs.target == 'true'
if: steps.determine.outputs.files_changed == 'true'
run: license_finder

# Upload it once for reference only. If it seems unnecessary, you can stop uploading.
- name: Generate HTML report
if: steps.changes.outputs.target == 'true'
run: license_finder report --format=html > license-report.html
- name: Upload HTML artifact
if: steps.changes.outputs.target == 'true'
uses: actions/upload-artifact@v4
with:
name: license-report
path: license-report.html
# Commit the License Finder report as docs/packages-license.md
- name: Generate license report
if: steps.determine.outputs.files_changed == 'true' && github.ref_name != github.event.repository.default_branch
run: license_finder report --format=markdown | tail -n +2 > "$LICENSE_REPORT"
- name: Commit license report and push
if: steps.determine.outputs.files_changed == 'true' && github.ref_name != github.event.repository.default_branch
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add "$LICENSE_REPORT"
git commit -m "Update $LICENSE_REPORT"
git push origin "$BRANCH_NAME"
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
9 changes: 0 additions & 9 deletions NOTICE.md

This file was deleted.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ For more details, please see the [contributing guide](CONTRIBUTING.md).
## License

Giselle is licensed under the [Apache License Version 2.0](LICENSE).

Licenses for third-party packages can be found in [docs/packages-license.md](docs/packages-license.md).
76 changes: 20 additions & 56 deletions config/dependency_decisions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,65 +49,11 @@
:why:
:versions: []
:when: 2024-09-18 06:46:06.140937000 Z
- - :approve
- caniuse-lite
- :who:
:why: This license is CC-BY-4.0. And added to NOTICE.md
:versions: []
:when: 2024-09-18 08:22:24.583085000 Z
- - :approve
- "@img/sharp-libvips-darwin-arm64"
- &3
:who:
:why: This license is LGPL-3.0-or-later. And added to NOTICE.md
:versions: []
:when: 2024-09-18 08:37:19.756571000 Z
- - :approve
- "@img/sharp-libvips-darwin-x64"
- *3
- - :approve
- "@img/sharp-libvips-dev"
- *3
- - :approve
- "@img/sharp-libvips-dev-wasm32"
- *3
- - :approve
- "@img/sharp-libvips-linux-arm"
- *3
- - :approve
- "@img/sharp-libvips-linux-arm64"
- *3
- - :approve
- "@img/sharp-libvips-linux-ppc64"
- *3
- - :approve
- "@img/sharp-libvips-linux-s390x"
- *3
- - :approve
- "@img/sharp-libvips-linux-x64"
- *3
- - :approve
- "@img/sharp-libvips-linuxmusl-arm64"
- *3
- - :approve
- "@img/sharp-libvips-linuxmusl-x64"
- *3
- - :approve
- "@img/sharp-libvips-win32-ia32"
- *3
- - :approve
- "@img/sharp-libvips-win32-x64"
- *3
- - :approve
- mdn-data
- :who:
:why: Not conflicting with Apache-2.0. And added to NOTICE.md
:versions: []
:when: 2024-09-27 04:12:38.962251000 Z
- - :approve
- "@vercel/flags"
- :who:
:why: The license is none. Check https://github.com/route06inc/giselle/issues/12 later
:why: The license is none. Check https://github.com/route06inc/giselle/issues/12
later
:versions: []
:when: 2024-10-08 09:38:17.316315298 Z
- - :permit
Expand All @@ -116,3 +62,21 @@
:why: To not conflict with Apache-2.0 license. https://zlib.net/zlib_license.html
:versions: []
:when: 2024-10-11 06:16:13.501764000 Z
- - :permit
- LGPL-3.0-or-later
- :who:
:why: To not conflict with Apache-2.0 license. https://opensource.org/license/LGPL-3.0
:versions: []
:when: 2024-10-22 07:22:03.743391000 Z
- - :permit
- CC0 1.0 Universal
- :who:
:why: To not conflict with Apache-2.0 license. https://creativecommons.org/publicdomain/zero/1.0/
:versions: []
:when: 2024-10-22 07:22:41.342554000 Z
- - :permit
- CC-BY-4.0
- :who:
:why: To not conflict with Apache-2.0 license. https://creativecommons.org/licenses/by/4.0/
:versions: []
:when: 2024-10-22 07:23:14.573790000 Z
Loading

0 comments on commit 14d51ae

Please sign in to comment.