Skip to content

Commit faa6c47

Browse files
authored
Merge pull request #267 from pantheon-systems/asset-only-release-1.5
Asset only release 1.5.0
2 parents d33775f + 6e0acbc commit faa6c47

File tree

3 files changed

+53
-19
lines changed

3 files changed

+53
-19
lines changed

.github/workflows/build-tag-release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,42 @@ permissions:
99
contents: write
1010

1111
jobs:
12+
check-status:
13+
name: Check Status
14+
runs-on: ubuntu-latest
15+
outputs:
16+
is-asset-update: ${{ steps.set-outputs.outputs.is-asset-update }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
- id: get-changed-files
20+
uses: jitterbit/get-changed-files@v1
21+
- id: set-outputs
22+
run: |
23+
echo "Changed files: ${{ steps.get-changed-files.outputs.all }}"
24+
shopt -s nocasematch
25+
run_plugin_update="true"
26+
for file in ${{ steps.get-changed-files.outputs.all }}; do
27+
if [[ ! "$file" =~ ^\.wordpress\.org/ ]] && [[ ! $file =~ ^\.github/ ]] && [[ "$file" != "readme.txt" ]] && [[ $file != "readme.md" ]]; then
28+
run_plugin_update="false"
29+
break
30+
fi
31+
done
32+
echo "::set-output name=is-asset-update::$run_plugin_update"
33+
asset-only:
34+
name: WP.org Asset Only Update
35+
needs: check-status
36+
if: ${{ needs.check-status.outputs.is-asset-update == 'true' }}
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
- name: WP.org Asset Only Update
41+
uses: 10up/action-wordpress-plugin-asset-update@stable
42+
env:
43+
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
44+
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
1245
tag:
46+
needs: check-status
47+
if: ${{ needs.check-status.outputs.is-asset-update == 'false' }}
1348
name: Create Tag and Draft Release
1449
runs-on: ubuntu-latest
1550
steps:
@@ -18,3 +53,4 @@ jobs:
1853
uses: pantheon-systems/plugin-release-actions/build-tag-release@main
1954
with:
2055
gh_token: ${{ github.token }}
56+
readme_md: README.md

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
**Tags:** pantheon, cdn, cache
55
**Requires at least:** 4.7
66
**Tested up to:** 6.4.3
7-
**Stable tag:** 1.5.0
7+
**Stable tag:** 1.5.0-dev
88
**License:** GPLv2 or later
99
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -142,7 +142,7 @@ Need a bit more power? In addition to `pantheon_wp_clear_edge_keys()`, there are
142142

143143
### Ignoring Specific Post Types ###
144144

145-
By default, Pantheon Advanced Page Cache is pretty aggressive in how it clears its surrogate keys. Specifically, any time `wp_insert_post` is called (which can include any time a post of any type is added or updated, even private post types), it will purge a variety of keys including `home`, `front`, `404` and `feed`. To bypass or override this behavior, since 1.5.0 we have a filter allowing an array of post types to ignore to be passed before those caches are purged. By default, the `revision` post type is ignored, but others can be added:
145+
By default, Pantheon Advanced Page Cache is pretty aggressive in how it clears its surrogate keys. Specifically, any time `wp_insert_post` is called (which can include any time a post of any type is added or updated, even private post types), it will purge a variety of keys including `home`, `front`, `404` and `feed`. To bypass or override this behavior, since 1.5.0-dev we have a filter allowing an array of post types to ignore to be passed before those caches are purged. By default, the `revision` post type is ignored, but others can be added:
146146

147147
```php
148148
/**
@@ -353,7 +353,7 @@ Pantheon Advanced Page Cache integrates with WordPress plugins, including:
353353
See [CONTRIBUTING.md](https://github.com/pantheon-systems/pantheon-advanced-page-cache/blob/master/CONTRIBUTING.md) for information on contributing.
354354

355355
## Changelog ##
356-
### 1.5.0 (March 11, 2024) ###
356+
### 1.5.0-dev (March 11, 2024) ###
357357
* Adds filter `pantheon_purge_post_type_ignored` to allow an array of post types to ignore before purging cache [[#258](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/258)]
358358
* Adds [wpunit-helpers](https://github.com/pantheon-systems/wpunit-helpers) for running/setting up WP Unit tests
359359

readme.txt

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -133,22 +133,20 @@ Need a bit more power? In addition to `pantheon_wp_clear_edge_keys()`, there are
133133

134134
= Ignoring Specific Post Types =
135135

136-
By default, Pantheon Advanced Page Cache is pretty aggressive in how it clears its surrogate keys. Specifically, any time `wp_insert_post` is called (which can include any time a post of any type is added or updated, even private post types), it will purge a variety of keys including `home`, `front`, `404` and `feed`. To bypass or override this behavior, since 1.5.0 we have a filter allowing an array of post types to ignore to be passed before those caches are purged. By default, the `revision` post type is ignored, but others can be added:
137-
138-
```php
139-
/**
140-
* Add a custom post type to the ignored post types.
141-
*
142-
* @param array $ignored_post_types The array of ignored post types.
143-
* @return array
144-
*/
145-
function filter_ignored_posts( $ignored_post_types ) {
146-
$ignored_post_types[] = 'my-post-type'; // Ignore my-post-type from cache purges.
147-
return $ignored_post_types;
148-
}
149-
150-
add_filter( 'pantheon_purge_post_type_ignored', 'filter_ignored_posts' );
151-
```
136+
By default, Pantheon Advanced Page Cache is pretty aggressive in how it clears its surrogate keys. Specifically, any time `wp_insert_post` is called (which can include any time a post of any type is added or updated, even private post types), it will purge a variety of keys including `home`, `front`, `404` and `feed`. To bypass or override this behavior, since 1.5.0-dev we have a filter allowing an array of post types to ignore to be passed before those caches are purged. By default, the `revision` post type is ignored, but others can be added:
137+
138+
/**
139+
* Add a custom post type to the ignored post types.
140+
*
141+
* @param array $ignored_post_types The array of ignored post types.
142+
* @return array
143+
*/
144+
function filter_ignored_posts( $ignored_post_types ) {
145+
$ignored_post_types[] = 'my-post-type'; // Ignore my-post-type from cache purges.
146+
return $ignored_post_types;
147+
}
148+
149+
add_filter( 'pantheon_purge_post_type_ignored', 'filter_ignored_posts' );
152150

153151
This will prevent the cache from being purged if the given post type is updated.
154152

0 commit comments

Comments
 (0)