spectralops / spectral-github-action Goto Github PK
View Code? Open in Web Editor NEWSpectral Security Integration into your Github Actions pipeline
License: MIT License
Spectral Security Integration into your Github Actions pipeline
License: MIT License
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
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?
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.