Conditionally set max-parallel attribute?

I’d like to set the max-parallel attribute for a strategy to 1 if it is a push to master and not set the attribute for PR. In my case, the PR workflow only runs terraform plan where order of operations doesn’t matter. However with the push to master, I run terraform apply where the order does matter and where each job will aquire a lock on the terraform state. This is the step that gets run on commit to master

      - name: Terraform Apply
        if: github.ref == 'refs/heads/master' && github.event_name == 'push'
        run: terraform apply -auto-approve 

Is this possible?

I ended up solving this with:

max-parallel: ${{ github.ref == 'refs/heads/master' && 1 || 10 }}