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

fix: do not use nested parameters #18

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ jobs:
- name: TrustyPkg Action
uses: stacklok/[email protected]
with:
score_threshold: 5
global_threshold: 5
provenance_threshold: 5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
Expand Down
66 changes: 32 additions & 34 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,38 @@ inputs:
GITHUB_TOKEN:
description: "GitHub token"
required: true
thresholds:
global:
description: "Raise global score below this score as an issue"
required: false
default: 5
repo_activity:
description: "Raise repo activity below this score as an issue"
required: false
default: 0
author_activity:
description: "Raise author activity below this score as an issue"
required: false
default: 0
provenance:
description: "Raise provenance below this score as an issue"
required: false
default: 0
typosquatting:
description: "Raise typosquatting below this score as an issue"
required: false
default: 0
fail_on:
malicious:
description: "Fail if package is malicious"
required: false
default: true
deprecated:
description: "Fail if package is deprecated"
required: false
default: true
archived:
description: "Fail if repo is archived"
required: false
default: true
global_threshold:
description: "Raise global score below this score as an issue"
required: false
default: 5
repo_activity_threshold:
description: "Raise repo activity below this score as an issue"
required: false
default: 0
author_activity_threshold:
description: "Raise author activity below this score as an issue"
required: false
default: 0
provenance_threshold:
description: "Raise provenance below this score as an issue"
required: false
default: 0
typosquatting_threshold:
description: "Raise typosquatting below this score as an issue"
required: false
default: 0
fail_on_malicious:
description: "Fail if package is malicious"
required: false
default: true
fail_on_deprecated:
description: "Fail if package is deprecated"
required: false
default: true
fail_on_archived:
description: "Fail if repo is archived"
required: false
default: true
runs:
using: "docker"
image: "Dockerfile"
Expand Down
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ func parseFail(failStr string, defaultFail string) bool {
func main() {
ctx := context.Background()

globalThreshold := parseScore(os.Getenv("INPUT_THRESHOLDS_GLOBAL"), "5")
repoActivityThreshold := parseScore(os.Getenv("INPUT_THRESHOLDS_REPO_ACTIVITY"), "0")
authorActivityThreshold := parseScore(os.Getenv("INPUT_THRESHOLDS_AUTHOR_ACTIVITY"), "0")
provenanceThreshold := parseScore(os.Getenv("INPUT_THRESHOLDS_PROVENANCE"), "0")
typosquattingThreshold := parseScore(os.Getenv("INPUT_THRESHOLDS_TYPOSQUATTING"), "0")
globalThreshold := parseScore(os.Getenv("INPUT_GLOBAL_THRESHOLD"), "5")
repoActivityThreshold := parseScore(os.Getenv("INPUT_REPO_ACTIVITY_THRESHOLD"), "0")
authorActivityThreshold := parseScore(os.Getenv("INPUT_AUTHOR_ACTIVITY_THRESHOLD"), "0")
provenanceThreshold := parseScore(os.Getenv("INPUT_PROVENANCE_THRESHOLD"), "0")
typosquattingThreshold := parseScore(os.Getenv("INPUT_TYPOSQUATTING_THRESHOLD"), "0")

failOnMalicious := parseFail(os.Getenv("INPUT_FAIL_ON_MALICIOUS"), "true")
failOnDeprecated := parseFail(os.Getenv("INPUT_FAIL_ON_DEPRECATED"), "true")
Expand Down
Loading