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

Example path: './sqlscripts/*.sql' doesn't work #206

Open
cuzzlor opened this issue Feb 9, 2024 · 3 comments
Open

Example path: './sqlscripts/*.sql' doesn't work #206

cuzzlor opened this issue Feb 9, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@cuzzlor
Copy link

cuzzlor commented Feb 9, 2024

When I try running two scripts as per this example:

path: './sqlscripts/*.sql'

I receive an error:

Error: Multiple files found matching pattern ./sqlscripts/*.sql

If only one script is supported, might be best to update the example code?

@cuzzlor cuzzlor added the need-to-triage Requires investigation label Feb 9, 2024
@dzsquared dzsquared self-assigned this Feb 9, 2024
Copy link

This issue is idle because it has been open for 14 days with no activity.

@github-actions github-actions bot added the idle Inactive for 14 days label Feb 23, 2024
@joe-schmirler
Copy link

joe-schmirler commented Feb 24, 2024

Unfortunately at the moment in V2.2, sql-action will only allow 1 script to be ran at a time, regardless of the readme stating scripts.

I got around this by creating a 1 dimensional matrix to iterate through a directory full of scripts.

example:

jobs:
  deploy_setup:
    runs-on: self-hosted
    steps:
      - uses: actions/checkout@v4
      - id: set-matrix
        run: echo "deploymatrix=$(ls /sqlscripts/*.sql | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
    outputs:
      deploymatrix: ${{ steps.set-matrix.outputs.deploymatrix }}
  mssqldeploy:
    needs: [deploy_setup]
    runs-on: self-hosted
    strategy:
      matrix:
        deployfiles: ${{ fromJson(needs.deploy_setup.outputs.deploymatrix) }}
      max-parallel: 1
    steps:
      - uses: actions/checkout@v4
      - name: Deploy to Target
        uses: Azure/sql-action@v2.2
        with:
          connection-string: "${{ secrets.CONNECTION_STRING }}"
          path: './${{ matrix.deployfiles }}'
          arguments: -b 

Also, see this Issue for more another similar Issue..

@github-actions github-actions bot removed the idle Inactive for 14 days label Feb 24, 2024
Copy link

github-actions bot commented Mar 9, 2024

This issue is idle because it has been open for 14 days with no activity.

@github-actions github-actions bot added the idle Inactive for 14 days label Mar 9, 2024
@dzsquared dzsquared added enhancement New feature or request and removed need-to-triage Requires investigation idle Inactive for 14 days labels Jun 20, 2024
@dzsquared dzsquared modified the milestone: v2.3 Jun 20, 2024
@dzsquared dzsquared removed this from the v2.3 milestone Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants