Git Product home page Git Product logo

spectral-github-action's People

Contributors

bennycode avatar chengadev avatar chkp-jrosenboom avatar cmpxchg16 avatar eladbash avatar guylev008 avatar lreuven avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

spectral-github-action's Issues

error: Found argument '--ok' which wasn't expected, or isn't valid in this context

I am using this config:

      - name: Install Spectral
        uses: spectralops/spectral-github-action@v2
        with:
          spectral-dsn: ${{ env.SPECTRAL_DSN }}
          spectral-args: --ok
      - name: Run Spectral
        run: spectral scan --github-format

Unfortunately my action fails with error message:

error: Found argument '--ok' which wasn't expected, or isn't valid in this context

Am I holding it wrong? The spectral-args with --ok is documented here: https://github.com/SpectralOps/spectral-github-action/tree/v2#configuration

Configure fail severity

Spectral's dashboard breaks issues down into errors, warnings & info.

I am using the following setup in my CI environment:

  spectral-code-scan:
    needs: [cancel-previous]
    runs-on: ubuntu-latest
    env:
      SPECTRAL_DSN: ${{ secrets.SPECTRAL_DSN }}
    steps:
      - name: Checkout Git repository
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Run Spectral (Base)
        uses: spectralops/spectral-github-action@v2
        with:
          spectral-dsn: ${{ env.SPECTRAL_DSN }}
          spectral-args: scan --github-format --include-tags base,audit

Unfortunately, this configuration makes my builds fail on simple warnings like this:

Warning: Environment configuration file [SENF073]

I don't want to use the --ok flag because this would also let severe errors pass. Is there a way to specify Spectral's GitHub Action to not fail on warnings?

Error: TypeError [ERR_INVALID_URL]: Invalid URL: /latest/dl/linux

For some reason github action errors: with

Error: TypeError [ERR_INVALID_URL]: Invalid URL: /latest/dl/linux

name: Scan code

on:
  pull_request:
    branches:
      - main

env:
  SPECTRAL_DSN: ${{ secrets.SPECTRAL_DSN }}

jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: spectralops/spectral-github-action@v2
        with:
          spectral-dsn: ${{ env.SPECTRAL_DSN }}
          spectral-args: scan --fail-on-error --github-format --include-tags base,audit

image

Run Spectral as part of the action

Hi @guylev008 , great work!
Is there a reason why there are 2 separate steps, one for installing and second for running?
It could be just:

    - name: Install and Run Spectral
      uses: spectralops/spectral-github-action@v1
      with:
        spectral-dsn: ${{ secrets.SPECTRAL_DSN }}

which would install and run spectral.
Maybe it's to be able to send arguments to spectral? then again, this could be send as parameters under with: of the single action.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.