From 2fb88fbe7031d050397d46edffd7956902dd4e94 Mon Sep 17 00:00:00 2001 From: leogermani Date: Wed, 6 Nov 2024 17:41:25 -0300 Subject: [PATCH 1/4] fix: avoid fatal on get_segments (#1359) --- includes/class-newspack-segments-model.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/class-newspack-segments-model.php b/includes/class-newspack-segments-model.php index d29ba0c0..ab09758e 100644 --- a/includes/class-newspack-segments-model.php +++ b/includes/class-newspack-segments-model.php @@ -352,6 +352,11 @@ public static function get_segments( $include_inactive = true ) { ] ); + // if, for any reason, this was called too early and we don't have a registered taxonomy yet, let's not break the site. + if ( ! is_array( $terms ) ) { + return []; + } + $segments = array_map( function ( $segment ) { return self::get_segment_from_term( $segment ); From b702303d8e0da1ece48dde6b1d469ecd498c4530 Mon Sep 17 00:00:00 2001 From: Adam Cassis Date: Mon, 11 Nov 2024 11:46:11 +0100 Subject: [PATCH 2/4] ci: update GH action URL --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 064fef26..704e1550 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Label when approved - uses: pullreminders/label-when-approved-action@master + uses: abinoda/label-when-approved-action@master env: APPROVALS: '1' GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e3fccc743f4b7707a33734afb1b98d0591fb1353 Mon Sep 17 00:00:00 2001 From: leogermani Date: Mon, 11 Nov 2024 09:49:56 -0300 Subject: [PATCH 3/4] chore: add changelog github workflow (#1361) --- .github/labeler.yml | 2 ++ .github/workflows/changelog.yml | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/changelog.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000..60b9b8cd --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,2 @@ +needs-changelog: + - base-branch: ['trunk'] diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 00000000..52534ece --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,36 @@ +name: "Pull Request Labeler" +on: + pull_request: + types: [closed] + +jobs: + labeler: + if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'trunk' + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 + + comment_pr: + if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'trunk' + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + name: Comment about the change log label + steps: + - name: Comment PR + uses: thollander/actions-comment-pull-request@v3 + with: + message: | + Hey @${{ github.event.pull_request.assignee.login }}, good job getting this PR merged! :tada: + + Now, the `needs-changelog` label has been added to it. + + Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label. + + If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label. + + Thank you! :heart: From 842c2b6a3ff4570ed3378f2e1e8a657c0b6d888f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 16:45:13 +0000 Subject: [PATCH 4/4] chore(deps): bump newspack-components from 3.0.0 to 3.1.0 Bumps [newspack-components](https://github.com/Automattic/newspack-plugin/tree/HEAD/src/components) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/Automattic/newspack-plugin/releases) - [Changelog](https://github.com/Automattic/newspack-plugin/blob/trunk/CHANGELOG.md) - [Commits](https://github.com/Automattic/newspack-plugin/commits/v3.1.0/src/components) --- updated-dependencies: - dependency-name: newspack-components dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 374e04f8..2e2d79c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "classnames": "^2.5.1", "intersection-observer": "^0.12.2", "js-cookie": "^3.0.5", - "newspack-components": "^3.0.0", + "newspack-components": "^3.1.0", "qs": "^6.13.0" }, "devDependencies": { @@ -18704,9 +18704,9 @@ } }, "node_modules/newspack-components": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/newspack-components/-/newspack-components-3.0.0.tgz", - "integrity": "sha512-uYu0lJ3OenBERe35+TbbajX8gtMfqH3kCEYYgBSYyHBUcHm9cebxgGsJFyN8HMdpylaR0lySfQy3ix/VTwC9kg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/newspack-components/-/newspack-components-3.1.0.tgz", + "integrity": "sha512-jQjFWmO3Z52a57ZFwKPV/rMpoUKSeNHPGrCHDTziJpRclapidqJyk9pIp4FKbks8Xc8g0zP4hH397Bk/treTJQ==", "dependencies": { "@wordpress/base-styles": "^5.0.0", "@wordpress/components": "^28.0.0", diff --git a/package.json b/package.json index 5be35b89..5ef5ff26 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "classnames": "^2.5.1", "intersection-observer": "^0.12.2", "js-cookie": "^3.0.5", - "newspack-components": "^3.0.0", + "newspack-components": "^3.1.0", "qs": "^6.13.0" }, "devDependencies": {