nrwl-nx-action icon indicating copy to clipboard operation
nrwl-nx-action copied to clipboard

How to handle argument placement?

Open jeremylvln opened this issue 1 year ago • 2 comments

Following this comment from @ValeriyMaslenikov. I'm questioning myself how to place the arguments in the Nx command:

  • Placing them by default after a -- will cause them to be ignored by Nx
  • So one cannot add Nx-specific arguments to the command (like --configuration=prod to handle production builds)
  • However, removing this -- will require anybody to add them on their own for their arguments to be handled correctly by the executor (and not by Nx directly)

Two solutions:

  1. We add another input called nxArgs (or something like that) to the action for specific arguments to add before the --
  2. We expect anybody to add the -- manually, which could lead to hard debugging

jeremylvln avatar Jan 30 '23 14:01 jeremylvln

Hey, @IamBlueSlime !

I think that probably these changes are still the reason for the incompatibility problems. We're using the @ago-dev/nx-aws-cdk-v2:deploy library to deploy the infrastructure using CDK constructs and based on the CI logs today it looks like this:

image

And on Friday we had a successful pipeline with the following output: image

There were no changes in the configuration within these days and here it's hot it looks like:

      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 16
      - run: npm ci
      - name: Configure aws credentials
        uses: aws-actions/configure-aws-credentials@master
        with:
          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
          aws-region: 'us-east-2'
      - name: Deploy
        uses: MansaGroup/nrwl-nx-action@v3
        with:
          targets: deploy
          projects: project-name
          args: '--configuration=prod'

ValeriyMaslenikov avatar Jan 30 '23 14:01 ValeriyMaslenikov

@ValeriyMaslenikov I've shipped a v3.2.2 update (without updating the v3 tag for now). I decided not to ship a breaking change and require the users to add the -- separator on their side if they need it (which not everybody does, including you with your usecase).

It would be awesome if you could test this release and report me if everything work as intended :)

jeremylvln avatar Jan 30 '23 15:01 jeremylvln