MansaGroup / nrwl-nx-action

A GitHub Action to wrap Nrwl Nx commands in your workflows.
MIT License
224 stars 19 forks source link

The "projects" paramater is ignored and nx runs all projects #325

Closed MayaHanna closed 1 year ago

MayaHanna commented 1 year ago

Bug Report

Current behavior

Hello! I'm trying to run the action with "projects" parameters, and instead of running only the project I defined, the action runs all the projects.


main.yml:

- name: Nrwl Nx uses: MansaGroup/nrwl-nx-action@v3.2.1 with: targets: e2e args: --verbose --mainArgs="--port=5000" affected: false projects: solar-dashboard-e2e all: false

The result:

`/usr/local/bin/npx nx run-many --target=e2e --all --verbose --mainArgs=--port=5000 --parallel=3

NX Running target e2e for 4 project(s):

  • solar-dashboard-e2e
  • solar-dashboard
  • image-analysis
  • main

With flags: --verbose=true --mainArgs=--port=5000`

I tried it also without "all"- same results.

jeremylvln commented 1 year ago

Hi @MayaHanna

I confirm the bug you have, by looking through the code I see that explicitly setting affected to false make the code falls into the first if condition here:

https://github.com/MansaGroup/nrwl-nx-action/blob/main/src/run-nx.ts#L119-L121

I will refactor this a bit to take into account the projects field first, which should solve the issue.

jeremylvln commented 1 year ago

I've released a new v3.2.2 version, but you can use v3 directly. Tell me if your issue is fixed :)