Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
guylev008 committed May 13, 2022
1 parent 33c4f4d commit 38a9c3b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 33 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ jobs:
- name: Install and run Spectral CI
uses: ./
with:
spectral-dsn: $SPECTRAL_DSN
spectral-dsn: ${{ secrets.SPECTRAL_DSN }}
spectral-args: --ok
scan-type: "CI"
ubuntu-audit:
name: Spectral ubuntu audit
runs-on: ubuntu-latest
Expand All @@ -26,9 +25,8 @@ jobs:
- name: Install and run Spectral Audit
uses: ./
with:
spectral-dsn: $SPECTRAL_DSN
spectral-dsn: ${{ secrets.SPECTRAL_DSN }}
spectral-args: github -k repo -t ${{ secrets.MY_GITHUB_TOKEN }} https://github.com/SpectralOps/spectral-github-action --include-tags base,audit --ok
scan-type: "Audit"
macos-ci:
name: Spectral macos CI
runs-on: ubuntu-latest
Expand All @@ -37,9 +35,8 @@ jobs:
- name: Install and run Spectral CI
uses: ./
with:
spectral-dsn: $SPECTRAL_DSN
spectral-dsn: ${{ secrets.SPECTRAL_DSN }}
spectral-args: --ok
scan-type: "CI"
macos-audit:
name: Spectral macos audit
runs-on: ubuntu-latest
Expand All @@ -48,9 +45,8 @@ jobs:
- name: Install and run Spectral Audit
uses: ./
with:
spectral-dsn: $SPECTRAL_DSN
spectral-dsn: ${{ secrets.SPECTRAL_DSN }}
spectral-args: github -k repo -t ${{ secrets.MY_GITHUB_TOKEN }} https://github.com/SpectralOps/spectral-github-action --include-tags base,audit --ok
scan-type: "Audit"
windows-ci:
name: Spectral windows CI
runs-on: windows-latest
Expand All @@ -59,9 +55,8 @@ jobs:
- name: Install and run Spectral CI
uses: ./
with:
spectral-dsn: $SPECTRAL_DSN
spectral-dsn: ${{ secrets.SPECTRAL_DSN }}
spectral-args: --ok
scan-type: "CI"
windows-audit:
name: Spectral windows audit
runs-on: windows-latest
Expand All @@ -70,6 +65,5 @@ jobs:
- name: Install and run Spectral Audit
uses: ./
with:
spectral-dsn: $SPECTRAL_DSN
spectral-dsn: ${{ secrets.SPECTRAL_DSN }}
spectral-args: github -k repo -t ${{ secrets.MY_GITHUB_TOKEN }} https://github.com/SpectralOps/spectral-github-action --include-tags base,audit --ok
scan-type: "Audit"
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ uses: spectral/spectral-action@v2
with:
spectral-dsn: $SPECTRAL_DSN
spectral-args: --ok
scan-type: "CI"
```

You can see an example of this Action [here](https://github.com/SpectralOps/spectral-github-action/tree/main/.github/workflows/main.yml)
Expand Down Expand Up @@ -58,7 +57,6 @@ jobs:
```
Spectral provides another scan option to audit your Github/Gitlab organizaion, user or repo.
Notice that you need to provide the audit scan type.
```yaml
name: Spectral
Expand All @@ -78,7 +76,6 @@ jobs:
with:
spectral-dsn: ${{ secrets.SPECTRAL_DSN }}
spectral-args: github -k repo -t ${{ secrets.MY_GITHUB_TOKEN }} https://github.com/SpectralOps/spectral-github-action --include-tags base,audit --ok
scan-type: "audit"
```
### How to Contribute
Expand Down
4 changes: 0 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ inputs:
spectral-args:
description: "Arguments for Spectral scan"
required: false
scan-type:
description: "CI or audit"
default: "CI"
required: false
branding:
icon: "download"
color: "purple"
Expand Down
15 changes: 1 addition & 14 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,6 @@ async function runSpectral() {
}

function getScanCommand() {
const scanType = core.getInput('scan-type')
const spectralArgs = core.getInput('spectral-args')
switch (scanType.toLowerCase()) {
case 'ci':
return `${process.platform === 'win32' ? 'spectral.exe scan' : 'spectral scan'} ${spectralArgs}`
case 'audit':
if (process.platform === win32) {
return `spectral.exe ${spectralArgs}`
}
else {
return `spectral ${spectralArgs}`
}
default:
throw new Error(`Unknown scan type: ${scanType}`);
}
return `${process.platform === 'win32' ? 'spectral.exe scan' : 'spectral scan'} ${spectralArgs}`
}

0 comments on commit 38a9c3b

Please sign in to comment.