Skip to content

Commit d13d208

Browse files
authored
Merge pull request #41 from Telefonica/release
Release v1.1.0
2 parents 132063f + 4b03de1 commit d13d208

File tree

18 files changed

+405
-123
lines changed

18 files changed

+405
-123
lines changed

.github/check-license-compliance.config.yml

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,42 @@ licenses:
55
allowed:
66
- Apache-2.0
77
- MIT
8-
- BSD
8+
- X11
9+
- BSD-2-Clause
10+
- BSD-3-Clause
911
- ISC
10-
- (MIT AND CC-BY-3.0)
12+
- Zlib
13+
- Unlicense
14+
- 0BSD
15+
- BlueOak-1.0.0
16+
- WTFPL
17+
- CC-BY-3.0
18+
- CC-BY-4.0
19+
- CC0-1.0
20+
- Python-2.0
1121
warning:
22+
- CC-BY-SA-3.0
23+
- CC-BY-SA-4.0
24+
- LGPL-2.1
25+
- LGPL-2.1-only
26+
- LGPL-2.1+
27+
- LGPL-2.1-or-later
1228
- LGPL-3.0
13-
- LGPL-2.0
29+
- LGPL-3.0-only
30+
- LGPL-3.0+
31+
- LGPL-3.0-or-later
32+
- MPL-1.1
1433
- MPL-2.0
1534
- EPL-1.0
16-
- CC-BY-4.0
17-
- Python-2.0
18-
- BlueOak-1.0.0
19-
- CC BY-SA 4.0
20-
- CC-BY-3.0
21-
- CC0-1.0
35+
- Artistic-2.0 # No problem to use it if we are not modifying the code
2236
forbidden:
37+
- GPL-2.0-only
38+
- GPL-2.0-or-later
39+
- GPL-3.0-only
40+
- GPL-3.0-or-later
2341
- AGPL-3.0
24-
- GPL-2.0
25-
- GPL-3.0
26-
allowWarnings: true
27-
# Options passed directly to the license-checker package
28-
licenseCheckerOptions:
29-
# Global options are applied to all types of checks
30-
global:
31-
excludePrivatePackages: true
32-
excludePackages: "@cspell/dict-en-common-misspellings@2.0.7"
33-
# You can also specify options for each type of check. They extend the global options
34-
# warning:
35-
# excludePrivatePackages: false
36-
# forbidden:
37-
# excludePrivatePackages: false
42+
log: debug
43+
npm:
44+
excludeModules:
45+
# The following packages have a license that is not a valid SPDX identifier
46+
- "babel-plugin-transform-import-meta@2.2.1" # BSD

.github/check-spdx-headers.config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ rules:
1616
headers:
1717
- files:
1818
- "templates/.github/**/*.yml"
19+
- "templates/check-license-compliance-configs/*.yml"
1920
license:
2021
- "MIT"
2122
copyright: "<%= year %> <%= copyrightHolder %>"
@@ -48,6 +49,9 @@ rules:
4849
- "\\d{4}(\\s-\\s\\d{4})? Telefónica Innovación Digital and contributors"
4950
- "\\d{4}(\\s-\\s\\d{4})? Telefónica Innovación Digital"
5051
- "\\d{4}(\\s-\\s\\d{4})? Telefónica"
52+
ignore:
53+
- "templates/.github/**/*.yml"
54+
- "templates/check-license-compliance-configs/*.yml"
5155
ignore:
5256
- "**/node_modules/**"
5357
- "dist/**"

.github/workflows/build.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,36 @@ jobs:
8383
# workflow artifact.
8484
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
8585
name: Upload Artifact
86-
id: upload
86+
id: upload-dist
8787
uses: actions/upload-artifact@v4
8888
with:
8989
name: dist
9090
path: dist/
91+
92+
# This will fail the workflow if the `dist-action/` directory is different than
93+
# expected.
94+
- name: Compare Directories
95+
id: diff-action
96+
run: |
97+
if [ ! -d dist-action/ ]; then
98+
echo "Expected dist-action/ directory does not exist. See status below:"
99+
ls -la ./
100+
exit 1
101+
fi
102+
if [ "$(git diff --ignore-space-at-eol --text dist-action/ | wc -l)" -gt "0" ]; then
103+
echo "Detected uncommitted changes after build. See status below:"
104+
git diff --ignore-space-at-eol --text dist-action/
105+
exit 1
106+
fi
107+
108+
# If `dist-action/` was different than expected, upload the expected version as a
109+
# workflow artifact.
110+
- if: ${{ failure() && steps.diff-action.outcome == 'failure' }}
111+
name: Upload Artifact
112+
id: upload-dist-action
113+
uses: actions/upload-artifact@v4
114+
with:
115+
name: dist-action
116+
path: dist-action/
117+
118+

.github/workflows/open-source-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
npm-token: ${{ secrets.NPM_TOKEN_XCUT }}
4444

4545
- name: Check License Compliance
46-
uses: Telefonica/check-license-compliance/.github/actions/check-and-comment@v1
46+
uses: Telefonica/check-license-compliance/.github/actions/check-and-comment@v3.0.0-beta.1
4747
with:
4848
config-file: .github/check-license-compliance.config.yml
4949
env:

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
#### Deprecated
1212
#### Removed
1313

14+
## [1.1.0] - 2025-02-13
15+
16+
### Added
17+
18+
* feat: Upgrade `check-license-compliance` to v3. Now it supports checking licenses from NPM, Maven, Python and Go dependencies. Update the action configuration accordingly
19+
* feat: Generate different `check-license-compliance` configurations based on the license type
20+
* feat: Add `check-license-compliance` options commented out to configuration file, so it is easier to understand what can be configured
21+
22+
### Changed
23+
24+
* chore: Bump `check-spdx-headers` action to version v1
25+
26+
### Fixed
27+
28+
* fix: Fix typo in "0BSD" license
29+
1430
## [1.0.1] - 2025-01-21
1531

1632
### Changed

README.md

Lines changed: 3 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ In detail, it includes:
88

99
* A __CLI for scaffolding open source projects__ with the standard files, including workflows for license compliance and integrity checks, community guidelines, and more. Read the [CLI section](#nodejs-cli) below for more information.
1010
* A __Github workflow__ automating the process of initializing a project with the standard files, by simply creating a new repository from this template and running the workflow. Read the [Repository template section](#repository-template) below for more information.
11-
* A __Github action__ enabling to check the scaffolding of open source projects, ensuring that some relevant files are not removed after project creation. Read the [Github action section](#github-action-for-checking-the-opensource-resources) below for more information.
11+
* A __Github action__ enabling to check the scaffolding of open source projects, ensuring that some relevant files are not removed after creating the project. Read the [Github action section](#github-action-for-checking-the-opensource-resources) below for more information.
1212

1313
## Table of Contents
1414

@@ -141,7 +141,7 @@ Once you initialize an open source project using this scaffold, it will include
141141
* Includes a check to ensure that the contributor has read the Code of Conduct.
142142
* __A Github Workflow with open source checks__: It is executed on every pull request and pushes to the main branch, and checks the following:
143143
* [__License Integrity check__](#license-integrity-check): Checks that all files in the project are rightly licensed. That is, it checks that all files have the expected license header according to the license chosen for the project and a given configuration.
144-
* [__License compliance check__](#license-compliance-check): Checks that the dependencies of the project are licensed under a license that is compatible with a given configuration. The configuration by default is the one defined in the [Practical Guide to Open Source Software at Telefónica](#preface), but can be customized.
144+
* [__License compliance check__](#license-compliance-check): Checks that the dependencies of the project are licensed under a license that is compatible with a given configuration. The configuration by default is the one defined in the [Practical Guide to Open Source Software at Telefónica](#preface) for the chosen project's license, but can be customized.
145145
* [__Open source resources check__](#opensource-resources-check): Checks that the project still contains the files that have been created by this scaffold, ensuring that the project always remains compliant with the open source guidelines.
146146
* [__A Github Workflow for automatic CLA signing__](#automatic-contributing-license-agreement): It automates the process of signing the CLA, by creating a comment in the pull request asking contributors who have not signed CLA to sign. It fails the pull request status check with a failure if the contributor has not signed the CLA.
147147
* __Changelog file__: A changelog file to keep track of the changes in the project. It is based on the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.
@@ -192,10 +192,7 @@ We want to ensure that the software we build is in compliance with our [licensin
192192

193193
This means that we are not incorporating third party software in the project under a license that is not compatible with the license selected for the overall project, or that is not compatible with the company's open source licensing guidelines.
194194

195-
For such purpose, this scaffold includes a job in the "Open Source Checks" workflow. This job uses the [Telefonica/check-license-compliance github action](https://github.com/Telefonica/check-license-compliance). The configuration of the action is defined in the `.github/check-license-compliance.config.yml` file. It is filled automatically with the [inputs](#inputs) provided when creating the scaffold, but it can be also customized manually to fit better your project's needs.
196-
197-
> [!WARNING]
198-
> The check is language dependent, and, for the moment, it only supports Node.js dependencies. You should comment it out if your project is not a Node.js project, and read the suggestions below to implement you or own check depending on the language of your project.
195+
For such purpose, this scaffold includes a job in the "Open Source Checks" workflow. This job uses the [Telefonica/check-license-compliance github action](https://github.com/Telefonica/check-license-compliance). The configuration of the action is defined in the `.github/check-license-compliance.config.yml` file. It is filled automatically based on the license provided when creating the scaffold, but it can be also customized manually to fit better your project's needs.
199196

200197
Please review the [licensing guidance](https://telefonicacorp.sharepoint.com/:w:/s/PatentOffice.TMEHI/EV1Yvq2kUhhCgy5FG-lryaYBWLwIRewSMZXsbZJeQ5uhlg?e=Mdrdwh&wdLOR=cCBDCEA92-4CAC-CF4A-BF60-44FC3F909578) when configuring the license compliance check. In case of doubt, please contact the Intellectual Property team, to the email address indicated in such document.
201198

@@ -204,53 +201,6 @@ Please review the [licensing guidance](https://telefonicacorp.sharepoint.com/:w:
204201
> [!TIP]
205202
> In repositories with [GitHub Advanced Security enabled](https://docs.github.com/en/get-started/learning-about-github/about-github-advanced-security), you may use the [Github's dependency-review-action](https://github.com/actions/dependency-review-action) instead of the [Telefonica/check-license-compliance github action](https://github.com/Telefonica/check-license-compliance). In such case, modify the `.github/workflows/open-source-checks.yml` to change the action used in the `check-license-compliance` job.
206203

207-
### Checking other languages than Node.js
208-
209-
As mentioned above, the [Telefonica/check-license-compliance github action](https://github.com/Telefonica/check-license-compliance) for the moment only supports Node.js dependencies. If your project is not a Node.js project, you should comment it out and implement your own check depending on the language of your project.
210-
211-
Here you have some suggestions about how to implement the check for some common languages until they are supported by our Github action:
212-
213-
<details>
214-
<summary>See code snippets</summary>
215-
216-
### Java
217-
218-
Run this to get the dependency license list.
219-
220-
```bash
221-
mvn org.codehaus.mojo:license-maven-plugin:aggregate-third-party-report
222-
```
223-
224-
When this is done, the result will be in ./target/site/aggregate-third-party-report.html.
225-
226-
### Python
227-
228-
```bash
229-
pip3 install --user pylic
230-
cd path/to/repo
231-
touch pyproject.toml
232-
pylic check
233-
```
234-
235-
### Go
236-
237-
```bash
238-
go install github.com/google/go-licenses@latest
239-
go-licenses check . --allowed_licenses=MIT,ISC,BSD-3-Clause,Apache-2.0,BSD-2-Clause,0BSD,CC-BY-4.0
240-
```
241-
242-
### PHP
243-
244-
```bash
245-
composer require dominikb/composer-license-checker
246-
composer exec composer-license-checker -- check
247-
```
248-
249-
> [!INFO]
250-
> These snippets are from the [eBay's open source program docs](https://opensource.ebay.com/contributing/approval/tooling/). Check the original source for more information.
251-
252-
</details>
253-
254204
## Next steps
255205

256206
Once you have used the scaffolding tools to create the resources, you should follow these steps to finalize the setup of your project:
@@ -259,8 +209,6 @@ Once you have used the scaffolding tools to create the resources, you should fol
259209
2. __Remember to configure the repository rules__: Remember to configure the branch protection rules to require the different checks in PRs, including the CLA signing check and the open source resources checks. Read the [Configuring the repository section](#configuring-the-repository) for more information.
260210
3. __Configure the License integrity check__: The scaffold creates a basic configuration for the license integrity check, but you should review it and adapt it to your project. Read the [License Integrity check](#license-integrity-check) section for more information.
261211
4. __Configure the License compliance check__: The repository creates a basic configuration for the license compliance check, but you should review it and adapt it to your project. Read the [License Compliance check](#license-compliance-check) section for more information.
262-
* Remember to modify the `.github/workflows/open-source-checks.yml` file to install the dependencies needed to run the check for your project's language in the `check-license-compliance` job. _(You'll find a TODO comment in the file indicating where to do it.)_
263-
* If your project is not a Node.js project, you should comment out the `check-license-compliance` job in the `.github/workflows/open-source-checks.yml` file and implement your own check depending on the language of your project.
264212
5. __Finish the README file__: The scaffold creates for you a `README.md` file with some basic information about the project and license, but you should fill it with the information about the project, how to install it, how to use it, etc. But remember to __always keep the "Contributing" and "License" sections__.
265213
6. __Finish the CONTRIBUTING file__: You should do the same with the `CONTRIBUTING.md` file. You should __fill the "Getting Started" section__ with the steps that a contributor should follow to start contributing to the project, and __add as many sections as needed to explain the contribution process__. But you should __always keep the rest of sections__ about the licensing of new files, code of conduct and the CLA.
266214

dist-action/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42954,7 +42954,7 @@ const RESOURCES = [
4295442954
{
4295542955
name: "Check license compliance config",
4295642956
path: ".github/check-license-compliance.config.yml",
42957-
origin: "templates/.github/check-license-compliance.config.yml",
42957+
origin: "templates/check-license-compliance-configs/<%= license %>.yml",
4295842958
},
4295942959
{
4296042960
name: "Check SPDX headers config",

dist-action/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-29.9 KB
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tid-xcut/opensource-scaffold",
3-
"version": "1.0.1",
3+
"version": "1.1.0",
44
"type": "module",
55
"description": "Scaffolding for open source projects. A CLI tool to create open source repositories tools and resources",
66
"packageManager": "pnpm@9.4.0",

0 commit comments

Comments
 (0)