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

📝 Added New Configuration Examples #18

Merged
merged 1 commit into from
Nov 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 51 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Please be aware there will be no direct output to the console, all found vulnera

<details>
<summary>
This configuration uses a different version of go (1.18) scans ./... and will fail if at least one vulnerability was found. Also it explicitly sets the github-token.
This configuration uses a different version of go (1.18) scans ./... and will fail if at least one vulnerability was found.
</summary>

```yaml
Expand All @@ -47,21 +47,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Running govulncheck
- name: Scan for Vulnerabilities in Code
uses: Templum/govulncheck-action@<version>
with:
go-version: 1.18
vulncheck-version: latest
package: ./...
github-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-vuln: true
```
</details>

<details>
<summary>
This configuration uses most of the default values, which are specified below. However it skips the upload to Github and instead uses the upload-artifact-action
to upload the result directly as build artifact.
This configuration uses most of the default values, which are specified below. However it skips the upload to Github and instead uses the upload-artifact-action to upload the result directly as build artifact.
</summary>

```yaml
Expand All @@ -72,7 +70,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Running govulncheck
- name: Scan for Vulnerabilities in Code
uses: Templum/govulncheck-action@<version>
with:
skip-upload: true
Expand All @@ -84,6 +82,53 @@ jobs:
```
</details>

<details>
<summary>
This configuration shows how to grant required permissions to the action in case you run into permission issues.
</summary>

```yaml
name: My Workflow
on: [push, pull_request]
permissions:
security-events: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Scan for Vulnerabilities in Code
uses: Templum/govulncheck-action@<version>
```
</details>

<details>
<summary>
The following configuration sets the action into DEBUG Mode. Which features verbose logging and allows access to the raw govulncheck JSON report.
</summary>

```yaml
name: My Debug Workflow
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Scan for Vulnerabilities in Code
uses: Templum/govulncheck-action@<version>
with:
skip-upload: true
env:
DEBUG: "true"
- name: Upload Report
uses: actions/upload-artifact@v3
with:
name: raw-report
path: raw-report.json
```
</details>

### Inputs

| Input | Description |
Expand Down