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

Feature / Enhancement Request To Exit With Status Code 1 When Results are Found #34

Closed
sinktech opened this issue May 20, 2021 · 1 comment
Assignees
Milestone

Comments

@sinktech
Copy link

Thanks for this project. I think it is awesome. So awesome in fact, that I wanted to throw it in a CI/CD pipeline. Would it be possible to update the application to exit with status 1 if results are returned? This will allow pipeline jobs to properly fail if there are high risk items detected vs the job always passing.

Attached is a Dockerfile I used to create an image ( Dockerfile.txt )

GitLab job looks something like this:

sql_check:
  stage: static_analysis
  image:
    name: <ACCOUNT>.dkr.ecr.<REGION>.amazonaws.com/cicd/sqlcheck:latest
  before_script:
    - git fetch
    - git checkout $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
    - sqlcheck --version
  script:
    - git diff --name-only $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
      origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME -c 'deployment/sql/*.sql' | xargs -I % -n1 sqlcheck -c -r 3 -v -f %
  when: always
  allow_failure: false
  only:
    refs:
      - merge_requests
    changes:
      - "deployment/sql/**/*.sql"
  except:
    refs:
      - master
      - /^release\/.*$/I

Thank you for the consideration.

@dzsquared
Copy link
Collaborator

resolved by #22, pending release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants