Skip to content

Commit

Permalink
run github actions conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidsector9 committed Nov 27, 2022
1 parent 545fecc commit 2c9e9ad
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 13 deletions.
26 changes: 26 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Directories
/.git
/.github
/.wordpress-org
/node_modules
/tests
/bin

# Files
.distignore
.editorconfig
.eslintrc.js
.gitignore
.wp-env.json
CHANGELOG.md
CODE_OF_CONDUCT.md
composer.json
composer.lock
CONTRIBUTING.md
CREDITS.md
LICENSE.md
package-lock.json
package.json
phpcs.xml
phpunit.xml.dist
README.md
31 changes: 27 additions & 4 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,40 @@ on:
branches:
- develop
- trunk
paths:
- '**.js'
- '**.php'
- '**.css'
pull_request:
branches:
- develop

jobs:
check-diffs:
runs-on: ubuntu-latest
outputs:
has_changed: ${{ steps.files-changed.outputs.RSA_FILES_CHANGED }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get updated files
id: changed-files
uses: tj-actions/changed-files@v32
with:
files: |
**/*.php
**/*.js
**/*.css
- id: files-changed
run: |
if [[ ( "${{ steps.changed-files.outputs.any_changed }}" == 'true' && "${{ github.event_name }}" == "pull_request" ) || "${{ github.event_name }}" == "push" ]]; then
echo "RSA_FILES_CHANGED=yes" >> $GITHUB_OUTPUT
fi
cypress:
runs-on: ubuntu-latest
needs: check-diffs
if: needs.check-diffs.outputs.has_changed == 'yes'
strategy:
matrix:
core:
Expand Down
25 changes: 22 additions & 3 deletions .github/workflows/php-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set PHP version
uses: shivammathur/setup-php@v2
Expand All @@ -29,8 +31,25 @@ jobs:
- name: Install dependencies
run: composer install

- name: Get updated PHP files
id: changed-files
uses: tj-actions/changed-files@v32
with:
files: |
**/*.php
- name: WPCS check
run: ./vendor/bin/phpcs .
run: |
if [[ "${{ steps.changed-files.outputs.any_changed }}" == 'true' && "${{ github.event_name }}" == "pull_request" ]]; then
./vendor/bin/phpcs ${{ steps.changed-files.outputs.all_changed_files }}
elif [[ "${{ github.event_name }}" == "push" ]]; then
./vendor/bin/phpcs .
fi
- name: PHP Compatibility check
run: ./vendor/bin/phpcs . --standard=PHPCompatibilityWP --ignore=vendor --extensions=php --runtime-set testVersion 7.4- --report=checkstyle | cs2pr
run: |
if [[ "${{ steps.changed-files.outputs.any_changed }}" == 'true' && "${{ github.event_name }}" == "pull_request" ]]; then
./vendor/bin/phpcs ${{ steps.changed-files.outputs.all_changed_files }} --standard=PHPCompatibilityWP --ignore=vendor --extensions=php --runtime-set testVersion 7.4- --report=checkstyle | cs2pr
elif [[ "${{ github.event_name }}" == "push" ]]; then
./vendor/bin/phpcs . --standard=PHPCompatibilityWP --ignore=vendor --extensions=php --runtime-set testVersion 7.4- --report=checkstyle | cs2pr
fi
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file, per [the Ke

## [Unreleased] - TBD

## [7.3.4] - 2022-11-01

### Fixed
- Fatal error due to missing vendor directory.

## [7.3.3] - 2022-10-31

### Added
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "restricted-site-access",
"version": "7.3.3",
"version": "7.3.4",
"description": "Limit access to visitors who are logged in or allowed by IP addresses. Includes many options for handling blocked visitors.",
"homepage": "https://github.com/10up/restricted-site-access#readme",
"license": "GPL-2.0-or-later",
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://10up.com/plugins/restricted-site-access-wordpress/
Tags: privacy, restricted, restrict, privacy, limited, permissions, security, block
Requires at least: 5.7
Tested up to: 6.1
Stable tag: 7.3.3
Stable tag: 7.3.4
Requires PHP: 7.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -198,6 +198,9 @@ Please note that setting `RSA_FORCE_RESTRICTION` will override `RSA_FORBID_RESTR

== Changelog ==

= 7.3.4 - 2022-11-01 =
* **Fixed:** Fatal error due to missing vendor directory.

= 7.3.3 - 2022-10-31 =
* **Added:** Support for IPv6 addresses (props [@jeffpaul](https://github.com/jeffpaul), [@Sidsector9](https://github.com/Sidsector9), [@cadic](https://github.com/cadic)).
* **Added:** Support for subnet range and pattern formats for IPv4 and IPv6 addresses (props [@jeffpaul](https://github.com/jeffpaul), [@Sidsector9](https://github.com/Sidsector9), [@cadic](https://github.com/cadic)).
Expand Down
4 changes: 2 additions & 2 deletions restricted_site_access.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Restricted Site Access
* Plugin URI: https://10up.com/plugins/restricted-site-access-wordpress/
* Description: <strong>Limit access your site</strong> to visitors who are logged in or accessing the site from a set of specific IP addresses. Send restricted visitors to the log in page, redirect them, or display a message or page. <strong>Powerful control over redirection</strong>, including <strong>SEO friendly redirect headers</strong>. Great solution for Extranets, publicly hosted Intranets, or parallel development sites.
* Version: 7.3.3
* Version: 7.3.4
* Requires at least: 5.7
* Requires PHP: 7.4
* Author: Jake Goldman, 10up, Oomph
Expand All @@ -15,7 +15,7 @@

require_once 'vendor/autoload.php';

define( 'RSA_VERSION', '7.3.2' );
define( 'RSA_VERSION', '7.3.4' );

/**
* Class responsible for all plugin funcitonality.
Expand Down

0 comments on commit 2c9e9ad

Please sign in to comment.