Azure / sql-action

🚀 Deploy changes to your SQL database easily with SQL projects or SQL scripts and sql-action for GitHub workflows
MIT License
103 stars 58 forks source link

SQLAction DriftReport fails to execute #166

Closed JoshFieldstad closed 1 year ago

JoshFieldstad commented 1 year ago

Problem description/replication steps

When sql-action is invoked like below:

      - name: Generate Drift Report
        uses: azure/sql-action@v2
        with:
          connection-string: ${{ secrets.BAR_CONNECTIONSTRING }}
          path: foo\bar.dacpac
          action: 'DriftReport'
          arguments: "/OutputPath:'${{ github.workspace }}/driftreport'"

The below error is given:

'SourceFile' is not a valid argument for the 'DriftReport' action.

To resolve this, I attempted to remove the path parameter from the azure/sql-action invocation. This throws the below error.

Error: Input required and not supplied: path

Microsoft documentation does not contain a /SourceFile: parameter for the sql package driftreport action. https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-deploy-drift-report?view=sql-server-ver16#driftreport-action-parameters

It looks like this could be resolved by modifying this case statement to only add /SourceFile: for Publish, Script, and Deploy report. https://github.com/Azure/sql-action/blob/master/src/AzureSqlAction.ts#:~:text=case%20SqlPackageAction.,break%3B

JoshFieldstad commented 1 year ago

I created a PR to show my thoughts on a fix here: https://github.com/Azure/sql-action/pull/167

dzsquared commented 1 year ago

thanks @JoshFieldstad - now shipped in https://github.com/Azure/sql-action/releases/tag/v2.1