Skip to content

Commit

Permalink
All Projects: Handle LICENSE.txt and SECURITY.md automatically. (#19831)
Browse files Browse the repository at this point in the history
* Add full GPL to the CLI generate skeleton Closes #19802

* Add GPL info to all plugin projects

* Add auto-licensing to build step

* Auto-copy security notice file
  • Loading branch information
kraftbj authored May 14, 2021
1 parent fc72006 commit ee64ef4
Show file tree
Hide file tree
Showing 18 changed files with 471 additions and 399 deletions.
19 changes: 19 additions & 0 deletions .github/files/build-all-projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,25 @@ for SLUG in "${SLUGS[@]}"; do
cp -r "$BASE/.github/files/gh-autotagger/." "$BUILD_DIR/.github/."
fi

# Copy license.
LICENSE=$(jq -r '.license // ""' composer.json)
if [[ -n "$LICENSE" ]]; then
echo "License: $LICENSE"
if cp "$BASE/.github/licenses/$LICENSE.txt" "$BUILD_DIR/LICENSE.txt"; then
echo "License file copied."
else
echo "::error file=projects/$SLUG/composer.json::License value not approved."
EXIT=1
continue
fi
else
echo "No license declared."
# TODO: Make this an error?
fi

# Copy SECURITY.md
cp "$BASE/SECURITY.md" "$BUILD_DIR/SECURITY.md"

# Copy only wanted files, based on .gitignore and .gitattributes.
{
# Include unignored files by default.
Expand Down
File renamed without changes.
14 changes: 14 additions & 0 deletions jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@
* Text Domain: jetpack
*
* @package automattic/jetpack
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

/**
Expand Down
5 changes: 5 additions & 0 deletions projects/js-packages/connection/changelog/add-license-info
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: added
Comment: Added license to build process


1 change: 1 addition & 0 deletions projects/js-packages/connection/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "automattic/js-connection",
"description": "Jetpack Connection Component.",
"license": "GPL-2.0-or-later",
"require": {},
"require-dev": {
"automattic/jetpack-changelogger": "1.2.x-dev"
Expand Down
15 changes: 15 additions & 0 deletions projects/js-packages/connection/index.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/**
* Components.
*/
Expand Down
5 changes: 5 additions & 0 deletions projects/plugins/backup/changelog/add-license-info
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: added
Comment: Added license to build process


16 changes: 16 additions & 0 deletions projects/plugins/backup/jetpack-backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@
* @package automattic/jetpack-backup
*/

/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}
Expand Down
14 changes: 0 additions & 14 deletions projects/plugins/backup/license.txt

This file was deleted.

Loading

0 comments on commit ee64ef4

Please sign in to comment.