Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only check plugin version integrity in deployment workflow if the plugin actually requires to be deployed #1666

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/deploy-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ jobs:
- name: Install npm dependencies
run: npm ci

- name: Check plugin versions
run: npm run versions -- --plugin=${{ matrix.plugin }}

- name: Build plugin
run: npm run build:plugin:${{ matrix.plugin }}

Expand Down Expand Up @@ -101,6 +98,10 @@ jobs:

echo "deploy=true" >> $GITHUB_OUTPUT

- name: Check plugin version integrity
if: steps.check-deployment.outputs.deploy == 'true'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocker: Instead of adding if: steps.check-deployment.outputs.deploy == 'true' condition in every steps can we add new step if output is not true the exit and remove condition from all other steps below?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how that would work in GitHub Actions. Maybe it's possible, but I'm not sure there's a way to properly exit out of a GitHub workflow. Do you have an idea about it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add the below new step after the Check if deployment is needed step and we can remove the if: steps.check-deployment.outputs.deploy == 'true' condition from all other steps after adding these step.

- name: Fail early if deployment check is false
  if: steps.check-deployment.outputs.deploy != 'true'
  run: |
    echo "Deployment condition not met. Exiting."
    exit 1

I did test in my folk repo - https://github.com/mukeshpanchal27/performance/actions/runs/11926864996/job/33241344801

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swissspidy Curious what's your take on the idea of early returns/exits in GitHub workflows.

run: npm run versions -- --plugin=${{ matrix.plugin }}

- name: Create zip file
if: steps.check-deployment.outputs.deploy == 'true'
run: |
Expand Down
6 changes: 6 additions & 0 deletions plugins/embed-optimizer/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ The [plugin source code](https://github.com/WordPress/performance/tree/trunk/plu

== Changelog ==

= n.e.x.t =

**Enhancements**

* Serve unminified scripts when `SCRIPT_DEBUG` is enabled. ([1643](https://github.com/WordPress/performance/pull/1643))

= 0.3.0 =

**Enhancements**
Expand Down
6 changes: 6 additions & 0 deletions plugins/image-prioritizer/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ The [plugin source code](https://github.com/WordPress/performance/tree/trunk/plu

== Changelog ==

= n.e.x.t =

**Enhancements**

* Serve unminified scripts when `SCRIPT_DEBUG` is enabled. ([1643](https://github.com/WordPress/performance/pull/1643))

= 0.2.0 =

**Enhancements**
Expand Down
6 changes: 6 additions & 0 deletions plugins/web-worker-offloading/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ The [plugin source code](https://github.com/WordPress/performance/tree/trunk/plu

== Changelog ==

= n.e.x.t =

**Enhancements**

* Serve unminified scripts when `SCRIPT_DEBUG` is enabled. ([1643](https://github.com/WordPress/performance/pull/1643))

= 0.1.1 =

**Enhancements**
Expand Down