Skip to content

Commit

Permalink
feat: do not run signing on pull requests (#935)
Browse files Browse the repository at this point in the history
* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

Signed-off-by: laurentsimon <laurentsimon@google.com>
  • Loading branch information
laurentsimon committed Sep 13, 2022
1 parent d733726 commit 6213479
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Expand Up @@ -33,7 +33,9 @@ func main() {
log.Fatalf("error during command execution: %v", err)
}

if os.Getenv(options.EnvInputPublishResults) == "true" {
if os.Getenv(options.EnvInputPublishResults) == "true" &&
// `pull_request` do not have the necessary `token-id: write` permissions.
os.Getenv("GITHUB_EVENT_NAME") != "pull_request" {
// Get json results by re-running scorecard.
jsonPayload, err := signing.GetJSONScorecardResults()
if err != nil {
Expand Down

0 comments on commit 6213479

Please sign in to comment.