From 809767883b81518dc0540a15da91ccd8a96b6d04 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Fri, 4 Dec 2020 10:07:48 -0800 Subject: [PATCH 01/10] Disable develop branch from triggering travis Temporary, while we move to GitHub Actions. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a2175a9a6..64e35cddc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,6 @@ php: - '7.4' branches: only: - - develop - master - build_test notifications: From 7b97cd0cf138a1bdae34b5543e50ee78f821109c Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 4 Dec 2020 12:21:42 -0700 Subject: [PATCH 02/10] ignore versions.yaml --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 12f83193e..26ca72dff 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ tests/_support/_generated/* tests/cache/* tests/error.log system/templates/testing/* +/user/config/versions.yaml From 47ab76c7e36e6b003f59f800d4824fc4d51a4b43 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Sat, 5 Dec 2020 16:53:14 -0800 Subject: [PATCH 03/10] =?UTF-8?q?=F0=9F=8E=89=20Moved=20Travis=20releases?= =?UTF-8?q?=20builds=20to=20Github=20Actions=20=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yaml | 45 ++++++++++++++++++++++++++++++++++++ .travis.yml | 1 - 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..af683a7f5 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,45 @@ +name: Release Builds + +on: + release: + types: [published] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.1 + extensions: opcache, gd + coverage: none + + - name: Install Dependencies + run: | + sudo apt-get -y update -qq < /dev/null > /dev/null + sudo apt-get -y install -qq git zip < /dev/null > /dev/null + + - name: Retrieval of Builder Scripts + run: | + # Real Grav URL + curl --silent -H "Authorization: token ${{ secrets.GLOBAL_TOKEN }}" -H "Accept: application/vnd.github.v3.raw" ${{ secrets.BUILD_SCRIPT_URL }} --output build-grav.sh + + # Development Local URL + # curl ${{ secrets.BUILD_SCRIPT_URL }} --output build-grav.sh + + - name: Grav Builder + run: | + bash ./build-grav.sh + + - name: Upload Grav Release Assets + id: upload-release-asset + uses: alexellis/upload-assets@0.2.2 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + asset_paths: '["./grav-dist/*.zip"]' diff --git a/.travis.yml b/.travis.yml index 64e35cddc..e7bc55645 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,6 @@ php: - '7.4' branches: only: - - master - build_test notifications: email: From 19719ecac1f6474c1bd5cccccdd9014c296c7480 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 7 Dec 2020 16:14:16 -0700 Subject: [PATCH 04/10] Added slack to tests --- .github/workflows/{tests.yml => tests.yaml} | 43 +++++++++++---------- 1 file changed, 22 insertions(+), 21 deletions(-) rename .github/workflows/{tests.yml => tests.yaml} (52%) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yaml similarity index 52% rename from .github/workflows/tests.yml rename to .github/workflows/tests.yaml index 8b88b7819..94b417d51 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yaml @@ -7,7 +7,8 @@ on: branches: [ develop ] jobs: - test: + + unit-tests: runs-on: ${{ matrix.os }} @@ -24,7 +25,7 @@ jobs: with: php-version: ${{ matrix.php }} extensions: opcache, gd - coverage: none + coverage: none - name: Validate composer.json and composer.lock run: composer validate @@ -38,7 +39,7 @@ jobs: with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- + restore-keys: ${{ runner.os }}-composer- - name: Install dependencies run: composer install --prefer-dist --no-progress @@ -46,21 +47,21 @@ jobs: - name: Run test suite run: vendor/bin/codecept run - - name: Slack Notification - uses: 8398a7/action-slack@v3 - with: - status: custom - fields: workflow,job,commit,repo,ref,author,took - custom_payload: | - { - username: 'action-slack', - icon_emoji: ':octocat:', - attachments: [{ - color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning', - text: `${process.env.AS_WORKFLOW}\n${process.env.AS_JOB} (${process.env.AS_COMMIT}) of ${process.env.AS_REPO}@${process.env.AS_REF} by ${process.env.AS_AUTHOR} succeeded in ${process.env.AS_TOOK}`, - }] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required - if: always() # Pick up events even if the job fails or is canceled. - + slack: + name: Slack + needs: unit-tests + runs-on: ubuntu-latest + if: always() + steps: + - uses: technote-space/workflow-conclusion-action@v2 + - uses: 8398a7/action-slack@v3 + with: + status: failure + fields: repo,message,author,action + icon_emoji: ':octocat:' + author_name: 'Github Action Tests' + text: '💥 Automated Test Failure' + env: + GITHUB_TOKEN: ${{ github.token }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + if: env.WORKFLOW_CONCLUSION == 'failure' From 29bcbf042ffda715ac534de5a85232b44c44c9a6 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 7 Dec 2020 16:19:34 -0700 Subject: [PATCH 05/10] Added slack on failure --- .github/workflows/build.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index af683a7f5..5ec057795 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -43,3 +43,22 @@ jobs: GITHUB_TOKEN: ${{ github.token }} with: asset_paths: '["./grav-dist/*.zip"]' + + slack: + name: Slack + needs: build + runs-on: ubuntu-latest + if: always() + steps: + - uses: technote-space/workflow-conclusion-action@v2 + - uses: 8398a7/action-slack@v3 + with: + status: failure + fields: repo,message,author,action + icon_emoji: ':octocat:' + author_name: 'Github Action Build' + text: '🚚 Automated Build Failure' + env: + GITHUB_TOKEN: ${{ github.token }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + if: env.WORKFLOW_CONCLUSION == 'failure' From db24d3e53e8cb0b886ff3fc58af855e03fe61a9c Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Wed, 9 Dec 2020 15:28:48 +0200 Subject: [PATCH 06/10] Fixed `pages` field escaping issues, needs admin update, too --- CHANGELOG.md | 6 ++++++ system/src/Grav/Common/Page/Pages.php | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96edf58e6..e48b89d83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.6.31 +## mm/dd/2020 + +1. [](#bugfix) + * Fixed `pages` field escaping issues, needs admin update, too [admin#1990](https://github.com/getgrav/grav-plugin-admin/issues/1990) + # v1.6.30 ## 12/03/2020 diff --git a/system/src/Grav/Common/Page/Pages.php b/system/src/Grav/Common/Page/Pages.php index 513a7ba2e..fa274b3d3 100644 --- a/system/src/Grav/Common/Page/Pages.php +++ b/system/src/Grav/Common/Page/Pages.php @@ -688,7 +688,7 @@ class Pages } /** - * Get list of route/title of all pages. + * Get list of route/title of all pages. Title is in HTML. * * @param PageInterface $current * @param int $level @@ -721,10 +721,10 @@ class Pages } if ($showFullpath) { - $option = $current->route(); + $option = htmlspecialchars($current->route()); } else { $extra = $showSlug ? '(' . $current->slug() . ') ' : ''; - $option = str_repeat('—-', $level). '▸ ' . $extra . $current->title(); + $option = str_repeat('—-', $level). '▸ ' . $extra . htmlspecialchars($current->title()); } From bc22c8d2b1efad6f28608aa937e9dd0485eac6d7 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 10 Dec 2020 10:41:42 -0700 Subject: [PATCH 07/10] Allow all css and js to be seached via robots.txt by default --- CHANGELOG.md | 2 ++ robots.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e48b89d83..88252e731 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # v1.6.31 ## mm/dd/2020 +1. [](#improved) + * Allow all CSS and JS via `robots.txt` [#2006](https://github.com/getgrav/grav/issues/2006) [#3067](https://github.com/getgrav/grav/issues/3067) 1. [](#bugfix) * Fixed `pages` field escaping issues, needs admin update, too [admin#1990](https://github.com/getgrav/grav-plugin-admin/issues/1990) diff --git a/robots.txt b/robots.txt index 96406e45e..9ac278fd4 100644 --- a/robots.txt +++ b/robots.txt @@ -11,3 +11,5 @@ Allow: /user/pages/ Allow: /user/themes/ Allow: /user/images/ Allow: / +Allow: *.css$ +Allow: *.js$ \ No newline at end of file From 1c63f4bf46af98c2eab86dbd845fadcf94ebb9e9 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 10 Dec 2020 10:54:38 -0700 Subject: [PATCH 08/10] Fix Twig `svg_image()` issue with classes applied to all elements #3068 --- CHANGELOG.md | 3 ++- system/src/Grav/Common/Twig/TwigExtension.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88252e731..dcbe25d9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,10 @@ ## mm/dd/2020 1. [](#improved) - * Allow all CSS and JS via `robots.txt` [#2006](https://github.com/getgrav/grav/issues/2006) [#3067](https://github.com/getgrav/grav/issues/3067) + * Allow all CSS and JS via `robots.txt` [#2006](https://github.com/getgrav/grav/issues/2006) [#3067](https://github.com/getgrav/grav/issues/3067) 1. [](#bugfix) * Fixed `pages` field escaping issues, needs admin update, too [admin#1990](https://github.com/getgrav/grav-plugin-admin/issues/1990) + * Fix `svg-image` issue with classes applied to all elements [#3068](https://github.com/getgrav/grav/issues/3068) # v1.6.30 ## 12/03/2020 diff --git a/system/src/Grav/Common/Twig/TwigExtension.php b/system/src/Grav/Common/Twig/TwigExtension.php index 5f234dfd5..3da65dd2a 100644 --- a/system/src/Grav/Common/Twig/TwigExtension.php +++ b/system/src/Grav/Common/Twig/TwigExtension.php @@ -1477,12 +1477,13 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn $matched = false; //Look for existing class - $svg = preg_replace_callback('/^/', function($matches) use ($classes, &$matched) { + $svg = preg_replace_callback('/^]*(class=\")([^"]*)(\")[^>]*>/', function($matches) use ($classes, &$matched) { if (isset($matches[2])) { $new_classes = $matches[2] . $classes; $matched = true; return str_replace($matches[1], "class=\"$new_classes\"", $matches[0]); } + return $matches[0]; }, $svg ); From 6a4686d17b8b2251a3b8fbd6ef736b7c44f7013a Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Thu, 10 Dec 2020 11:19:27 -0800 Subject: [PATCH 09/10] Update composer first thing --- .github/workflows/tests.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 94b417d51..ca8cb16b3 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -27,6 +27,9 @@ jobs: extensions: opcache, gd coverage: none + - name: Update composer + run: composer update + - name: Validate composer.json and composer.lock run: composer validate From d9c14455424babd6292acdc1caf33e03990bbe51 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 14 Dec 2020 21:28:42 -0700 Subject: [PATCH 10/10] prepare for release --- CHANGELOG.md | 2 +- system/defines.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcbe25d9b..30f526a95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # v1.6.31 -## mm/dd/2020 +## 12/14/2020 1. [](#improved) * Allow all CSS and JS via `robots.txt` [#2006](https://github.com/getgrav/grav/issues/2006) [#3067](https://github.com/getgrav/grav/issues/3067) diff --git a/system/defines.php b/system/defines.php index 086b246c3..4f5164d37 100644 --- a/system/defines.php +++ b/system/defines.php @@ -8,7 +8,7 @@ // Some standard defines define('GRAV', true); -define('GRAV_VERSION', '1.6.30'); +define('GRAV_VERSION', '1.6.31'); define('GRAV_TESTING', false); define('DS', '/');